Class NumberOnly
java.lang.Object
java.lang.Number
org.soliscode.test.interfaces.NumberOnly
- All Implemented Interfaces:
Serializable
The NumberOnly
lass wraps any object and only exposes the methods on the Number
interface. This is used for
testing a class or method implementation that operates on a Number
without any optimizations for the
instantiated class or any other implemented interfaces.
Objects of this class should be created using the Interfaces
utility class:
Integer i = 3;
Number n = Interfaces.numberOnly(i);
- Since:
- 1.0
- Author:
- evanbergstrom
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNumberOnly
(@NotNull Number number) Creates an instance ofNumberOnly
that wraps an instance ofNumber
and narrows the interface to only the methods available in theNumber
interface. -
Method Summary
Methods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
NumberOnly
Creates an instance ofNumberOnly
that wraps an instance ofNumber
and narrows the interface to only the methods available in theNumber
interface.- Parameters:
number
- an instance of number to wrap.
-
-
Method Details
-
hashCode
-
equals
-
toString
-
intValue
-
longValue
-
floatValue
public float floatValue()- Specified by:
floatValue
in classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in classNumber
-
listOf
Creates aList
ofNumberOnly
values based upon a list of integer constants.- Parameters:
values
- The integer values.- Returns:
- a list of
NumberOnly
values.
-