Class MarshallValueImpl
- java.lang.Object
-
- com.sdicons.json.serializer.marshall.MarshallValueImpl
-
- All Implemented Interfaces:
MarshallValue
public class MarshallValueImpl extends java.lang.Object implements MarshallValue
-
-
Field Summary
Fields Modifier and Type Field Description private booleanresultBooleanprivate byteresultByteprivate charresultCharprivate doubleresultDoubleprivate floatresultFloatprivate intresultIntprivate longresultLongprivate java.lang.ObjectresultReferenceprivate shortresultShortprivate intresultType
-
Constructor Summary
Constructors Modifier Constructor Description privateMarshallValueImpl()MarshallValueImpl(boolean aBool)MarshallValueImpl(byte aByte)MarshallValueImpl(char aChar)MarshallValueImpl(double aDouble)MarshallValueImpl(float aFloat)MarshallValueImpl(int aInt)MarshallValueImpl(long aLong)MarshallValueImpl(short aShort)MarshallValueImpl(java.lang.Object aReference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleangetBoolean()Get the primitive boolean value.bytegetByte()Get the primitive byte value.chargetChar()Get the primitive char value.doublegetDouble()Get the primitive double value.floatgetFloat()Get the primitive float value.intgetInt()Get the primitive int value.longgetLong()Get the primitive long value.java.lang.ObjectgetReference()Get the reference to a Java object.shortgetShort()Get the primitive short value.intgetType()Get the type of the value so that you can access its value safely.
-
-
-
Field Detail
-
resultBoolean
private boolean resultBoolean
-
resultByte
private byte resultByte
-
resultShort
private short resultShort
-
resultChar
private char resultChar
-
resultInt
private int resultInt
-
resultLong
private long resultLong
-
resultFloat
private float resultFloat
-
resultDouble
private double resultDouble
-
resultReference
private java.lang.Object resultReference
-
resultType
private int resultType
-
-
Constructor Detail
-
MarshallValueImpl
private MarshallValueImpl()
-
MarshallValueImpl
public MarshallValueImpl(boolean aBool)
-
MarshallValueImpl
public MarshallValueImpl(byte aByte)
-
MarshallValueImpl
public MarshallValueImpl(char aChar)
-
MarshallValueImpl
public MarshallValueImpl(double aDouble)
-
MarshallValueImpl
public MarshallValueImpl(float aFloat)
-
MarshallValueImpl
public MarshallValueImpl(int aInt)
-
MarshallValueImpl
public MarshallValueImpl(long aLong)
-
MarshallValueImpl
public MarshallValueImpl(short aShort)
-
MarshallValueImpl
public MarshallValueImpl(java.lang.Object aReference)
-
-
Method Detail
-
getType
public int getType()
Description copied from interface:MarshallValueGet the type of the value so that you can access its value safely.- Specified by:
getTypein interfaceMarshallValue- Returns:
- One of the getValues BOOLEAN, BYTE, SHORT CHAR, INT, LONG, FLOAT, DOUBLE, REFERENCE.
-
getBoolean
public boolean getBoolean() throws MarshallExceptionDescription copied from interface:MarshallValueGet the primitive boolean value.- Specified by:
getBooleanin interfaceMarshallValue- Returns:
- The unmarshalled boolean value.
- Throws:
MarshallException- If it is not a boolean representation.
-
getByte
public byte getByte() throws MarshallExceptionDescription copied from interface:MarshallValueGet the primitive byte value.- Specified by:
getBytein interfaceMarshallValue- Returns:
- The unmarshalled byte value.
- Throws:
MarshallException- If it is not a byte representation.
-
getShort
public short getShort() throws MarshallExceptionDescription copied from interface:MarshallValueGet the primitive short value.- Specified by:
getShortin interfaceMarshallValue- Returns:
- The unmarshalled short value.
- Throws:
MarshallException- If it is not a short representation.
-
getChar
public char getChar() throws MarshallExceptionDescription copied from interface:MarshallValueGet the primitive char value.- Specified by:
getCharin interfaceMarshallValue- Returns:
- The unmarshalled char value.
- Throws:
MarshallException- If it is not a char representation.
-
getInt
public int getInt() throws MarshallExceptionDescription copied from interface:MarshallValueGet the primitive int value.- Specified by:
getIntin interfaceMarshallValue- Returns:
- The unmarshalled int value.
- Throws:
MarshallException- If it is not an int representation.
-
getLong
public long getLong() throws MarshallExceptionDescription copied from interface:MarshallValueGet the primitive long value.- Specified by:
getLongin interfaceMarshallValue- Returns:
- The unmarshalled long value.
- Throws:
MarshallException- If it is not a long representation.
-
getFloat
public float getFloat() throws MarshallExceptionDescription copied from interface:MarshallValueGet the primitive float value.- Specified by:
getFloatin interfaceMarshallValue- Returns:
- The unmarshalled float value.
- Throws:
MarshallException- If it is not a float representation.
-
getDouble
public double getDouble() throws MarshallExceptionDescription copied from interface:MarshallValueGet the primitive double value.- Specified by:
getDoublein interfaceMarshallValue- Returns:
- The unmarshalled primitive value.
- Throws:
MarshallException- If it is not a double representation.
-
getReference
public java.lang.Object getReference() throws MarshallExceptionDescription copied from interface:MarshallValueGet the reference to a Java object.- Specified by:
getReferencein interfaceMarshallValue- Returns:
- The unmarshalled reference to the Java object.
- Throws:
MarshallException- If it is not a reference representation.
-
-