1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package com.xpn.xwiki.objects

File NumberProperty.java

 

Coverage histogram

../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

4
15
8
1
89
56
10
0.67
1.88
8
1.25

Classes

Class Line # Actions
NumberProperty 25 15 0% 10 2
0.925925992.6%
 

Contributing tests

This file is covered by 152 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package com.xpn.xwiki.objects;
21   
22    import org.apache.commons.lang3.builder.EqualsBuilder;
23    import org.apache.commons.lang3.builder.HashCodeBuilder;
24   
 
25    public abstract class NumberProperty extends BaseProperty
26    {
27    private Number value;
28   
 
29  1631560 toggle public NumberProperty()
30    {
31    }
32   
 
33  6539437 toggle @Override
34    public Object getValue()
35    {
36  6539418 return this.value;
37    }
38   
 
39  4659145 toggle @Override
40    public void setValue(Object value)
41    {
42  4659154 setValueDirty(value);
43  4659144 this.value = (Number) value;
44    }
45   
 
46  890936 toggle @Override
47    public String toText()
48    {
49  890938 Number nb = (Number) getValue();
50  890936 return (nb == null) ? "" : nb.toString();
51    }
52   
 
53  68167 toggle @Override
54    public boolean equals(Object obj)
55    {
56  68167 if (obj == null) {
57  0 return false;
58    }
59   
60  68167 return new EqualsBuilder().appendSuper(super.equals(obj))
61    .append(getValue(), ((NumberProperty) obj).getValue())
62    .isEquals();
63    }
64   
 
65  12 toggle @Override
66    public int hashCode()
67    {
68  12 HashCodeBuilder builder = new HashCodeBuilder();
69   
70  12 builder.appendSuper(super.hashCode());
71  12 builder.append(getValue());
72   
73  12 return builder.toHashCode();
74    }
75   
 
76  3038374 toggle @Override
77    public NumberProperty clone()
78    {
79  3038380 return (NumberProperty) super.clone();
80    }
81   
 
82  3038368 toggle @Override
83    protected void cloneInternal(BaseProperty clone)
84    {
85  3038369 NumberProperty property = (NumberProperty) clone;
86  3038355 property.setValue(getValue());
87    }
88   
89    }