1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package com.xpn.xwiki.objects

File NumberProperty.java

 

Coverage histogram

../../../../img/srcFileCovDistChart9.png
38% of files have more coverage

Code metrics

4
11
7
1
77
47
9
0.82
1.57
7
1.29

Classes

Class Line # Actions
NumberProperty 24 11 0% 9 2
0.9090909490.9%
 

Contributing tests

This file is covered by 114 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   
 
24    public abstract class NumberProperty extends BaseProperty
25    {
26    private Number value;
27   
 
28  527108 toggle public NumberProperty()
29    {
30    }
31   
 
32  1164312 toggle @Override
33    public Object getValue()
34    {
35  1164313 return this.value;
36    }
37   
 
38  912496 toggle @Override
39    public void setValue(Object value)
40    {
41  912501 setValueDirty(value);
42  912503 this.value = (Number) value;
43    }
44   
 
45  327502 toggle @Override
46    public String toText()
47    {
48  327502 Number nb = (Number) getValue();
49  327502 return (nb == null) ? "" : nb.toString();
50    }
51   
 
52  32365 toggle @Override
53    public boolean equals(Object obj)
54    {
55  32365 if (obj == null) {
56  0 return false;
57    }
58   
59  32365 return new EqualsBuilder().appendSuper(super.equals(obj))
60    .append(getValue(), ((NumberProperty) obj).getValue())
61    .isEquals();
62    }
63   
 
64  385489 toggle @Override
65    public NumberProperty clone()
66    {
67  385490 return (NumberProperty) super.clone();
68    }
69   
 
70  385477 toggle @Override
71    protected void cloneInternal(BaseProperty clone)
72    {
73  385477 NumberProperty property = (NumberProperty) clone;
74  385480 property.setValue(getValue());
75    }
76   
77    }