|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.ezmorph.object.AbstractObjectMorpher
net.sf.ezmorph.object.NumberMorpher
public final class NumberMorpher
Morphs to a subclass of Number.
Supported types are - Byte, Short, Integer, Long, Float, BigInteger,
BigtDecimal.
| 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. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object obj)
|
Number |
getDefaultValue()
Returns the default value for this Morpher. |
int |
hashCode()
|
Object |
morph(Object value)
Morphs the input object into an output object of the supported type. |
Class |
morphsTo()
Returns the target Class for conversion. |
void |
setDefaultValue(Number defaultValue)
Sets the defaultValue to use if the value to be morphed is null. |
| Methods inherited from class net.sf.ezmorph.object.AbstractObjectMorpher |
|---|
isUseDefault, setUseDefault, supports |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NumberMorpher(Class type)
type - must be a primitive or wrapper type. BigDecimal and BigInteger
are also supported.
public NumberMorpher(Class type,
Number defaultValue)
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| Method Detail |
|---|
public boolean equals(Object obj)
equals in class Objectpublic Number getDefaultValue()
public int hashCode()
hashCode in class Objectpublic Object morph(Object value)
ObjectMorpher
value - The input value to be morphedpublic Class morphsTo()
Morpher
public void setDefaultValue(Number defaultValue)
morphsTo().
defaultValue - return value if the value to be morphed is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||