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 boolean
resultBoolean
private byte
resultByte
private char
resultChar
private double
resultDouble
private float
resultFloat
private int
resultInt
private long
resultLong
private java.lang.Object
resultReference
private short
resultShort
private int
resultType
-
Constructor Summary
Constructors Modifier Constructor Description private
MarshallValueImpl()
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 boolean
getBoolean()
Get the primitive boolean value.byte
getByte()
Get the primitive byte value.char
getChar()
Get the primitive char value.double
getDouble()
Get the primitive double value.float
getFloat()
Get the primitive float value.int
getInt()
Get the primitive int value.long
getLong()
Get the primitive long value.java.lang.Object
getReference()
Get the reference to a Java object.short
getShort()
Get the primitive short value.int
getType()
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:MarshallValue
Get the type of the value so that you can access its value safely.- Specified by:
getType
in interfaceMarshallValue
- Returns:
- One of the getValues BOOLEAN, BYTE, SHORT CHAR, INT, LONG, FLOAT, DOUBLE, REFERENCE.
-
getBoolean
public boolean getBoolean() throws MarshallException
Description copied from interface:MarshallValue
Get the primitive boolean value.- Specified by:
getBoolean
in interfaceMarshallValue
- Returns:
- The unmarshalled boolean value.
- Throws:
MarshallException
- If it is not a boolean representation.
-
getByte
public byte getByte() throws MarshallException
Description copied from interface:MarshallValue
Get the primitive byte value.- Specified by:
getByte
in interfaceMarshallValue
- Returns:
- The unmarshalled byte value.
- Throws:
MarshallException
- If it is not a byte representation.
-
getShort
public short getShort() throws MarshallException
Description copied from interface:MarshallValue
Get the primitive short value.- Specified by:
getShort
in interfaceMarshallValue
- Returns:
- The unmarshalled short value.
- Throws:
MarshallException
- If it is not a short representation.
-
getChar
public char getChar() throws MarshallException
Description copied from interface:MarshallValue
Get the primitive char value.- Specified by:
getChar
in interfaceMarshallValue
- Returns:
- The unmarshalled char value.
- Throws:
MarshallException
- If it is not a char representation.
-
getInt
public int getInt() throws MarshallException
Description copied from interface:MarshallValue
Get the primitive int value.- Specified by:
getInt
in interfaceMarshallValue
- Returns:
- The unmarshalled int value.
- Throws:
MarshallException
- If it is not an int representation.
-
getLong
public long getLong() throws MarshallException
Description copied from interface:MarshallValue
Get the primitive long value.- Specified by:
getLong
in interfaceMarshallValue
- Returns:
- The unmarshalled long value.
- Throws:
MarshallException
- If it is not a long representation.
-
getFloat
public float getFloat() throws MarshallException
Description copied from interface:MarshallValue
Get the primitive float value.- Specified by:
getFloat
in interfaceMarshallValue
- Returns:
- The unmarshalled float value.
- Throws:
MarshallException
- If it is not a float representation.
-
getDouble
public double getDouble() throws MarshallException
Description copied from interface:MarshallValue
Get the primitive double value.- Specified by:
getDouble
in interfaceMarshallValue
- Returns:
- The unmarshalled primitive value.
- Throws:
MarshallException
- If it is not a double representation.
-
getReference
public java.lang.Object getReference() throws MarshallException
Description copied from interface:MarshallValue
Get the reference to a Java object.- Specified by:
getReference
in interfaceMarshallValue
- Returns:
- The unmarshalled reference to the Java object.
- Throws:
MarshallException
- If it is not a reference representation.
-
-