Interface MarshallValue
- All Known Implementing Classes:
MarshallValueImpl
public interface MarshallValue
This interface represents an object that is the result of converting a JSON structure
into a java structure. A dedicated interface is supplied because you cannot know
in advance whether the result will be a primitive type or a reference type.
This interface lets you investigate which kind of value is returned before you use it.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the primitive boolean value.byte
getByte()
Get the primitive byte value.char
getChar()
Get the primitive char value.double
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.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 Details
-
BOOLEAN
static final int BOOLEAN- See Also:
-
BYTE
static final int BYTE- See Also:
-
SHORT
static final int SHORT- See Also:
-
CHAR
static final int CHAR- See Also:
-
INT
static final int INT- See Also:
-
LONG
static final int LONG- See Also:
-
FLOAT
static final int FLOAT- See Also:
-
DOUBLE
static final int DOUBLE- See Also:
-
REFERENCE
static final int REFERENCE- See Also:
-
-
Method Details
-
getBoolean
Get the primitive boolean value.- Returns:
- The unmarshalled boolean value.
- Throws:
MarshallException
- If it is not a boolean representation.
-
getByte
Get the primitive byte value.- Returns:
- The unmarshalled byte value.
- Throws:
MarshallException
- If it is not a byte representation.
-
getShort
Get the primitive short value.- Returns:
- The unmarshalled short value.
- Throws:
MarshallException
- If it is not a short representation.
-
getChar
Get the primitive char value.- Returns:
- The unmarshalled char value.
- Throws:
MarshallException
- If it is not a char representation.
-
getInt
Get the primitive int value.- Returns:
- The unmarshalled int value.
- Throws:
MarshallException
- If it is not an int representation.
-
getLong
Get the primitive long value.- Returns:
- The unmarshalled long value.
- Throws:
MarshallException
- If it is not a long representation.
-
getFloat
Get the primitive float value.- Returns:
- The unmarshalled float value.
- Throws:
MarshallException
- If it is not a float representation.
-
getDouble
Get the primitive double value.- Returns:
- The unmarshalled primitive value.
- Throws:
MarshallException
- If it is not a double representation.
-
getReference
Get the reference to a Java object.- Returns:
- The unmarshalled reference to the Java object.
- Throws:
MarshallException
- If it is not a reference representation.
-
getType
int getType()Get the type of the value so that you can access its value safely.- Returns:
- One of the getValues BOOLEAN, BYTE, SHORT CHAR, INT, LONG, FLOAT, DOUBLE, REFERENCE.
-