net.sf.ezmorph.object
public final class NumberMorpher extends AbstractObjectMorpher
Constructor Summary | |
---|---|
NumberMorpher(Class type)
Creates a new morpher for the target type.
| |
NumberMorpher(Class type, Number defaultValue)
Creates a new morpher for the target type with a default value. The defaultValue should be of the same class as the target type. |
Method Summary | |
---|---|
boolean | equals(Object obj) |
Number | getDefaultValue()
Returns the default value for this Morpher. |
int | hashCode() |
Object | morph(Object value) |
Class | morphsTo() |
void | setDefaultValue(Number defaultValue)
Sets the defaultValue to use if the value to be morphed is null. The defaultValue should be of the same class as the type this morpher returns with morphsTo() .
|
Parameters: type must be a primitive or wrapper type. BigDecimal and BigInteger are also supported.
Parameters: type must be a primitive or wrapper type. BigDecimal and BigInteger are also supported. defaultValue return value if the value to be morphed is null
morphsTo()
.
Parameters: defaultValue return value if the value to be morphed is null