public class ConversionHelper extends Object
ConversionHelper
class is used for converting values
carried by messages into specified types, if possible.Constructor and Description |
---|
ConversionHelper() |
Modifier and Type | Method and Description |
---|---|
static boolean |
toBoolean(Object value)
Gets the boolean value of the given object.
|
static byte |
toByte(Object value)
Gets the byte value of the given object.
|
static byte[] |
toBytes(Object value)
Gets the bytes value of the given object.
|
static char |
toChar(Object value)
Gets the char value of the given object.
|
static double |
toDouble(Object value)
Gets the double value of the given object.
|
static float |
toFloat(Object value)
Gets the float value of the given object.
|
static int |
toInt(Object value)
Gets the int value of the given object.
|
static long |
toLong(Object value)
Gets the long value of the given object.
|
static short |
toShort(Object value)
Gets the short value of the given object.
|
static String |
toString(Object value)
Gets the String value of the given object.
|
public static boolean toBoolean(Object value) throws MessageValueException
MessageValueException
- If the given object can't be converted
into a boolean value.public static byte toByte(Object value) throws MessageValueException
MessageValueException
- If the given object can't be converted
into a byte value.public static short toShort(Object value) throws MessageValueException
MessageValueException
- If the given object can't be converted
into a short value.public static int toInt(Object value) throws MessageValueException
MessageValueException
- If the given object can't be converted
into an int value.public static long toLong(Object value) throws MessageValueException
MessageValueException
- If the given object can't be converted
into a long value.public static float toFloat(Object value) throws MessageValueException
MessageValueException
- If the given object can't be converted
into a float value.public static double toDouble(Object value) throws MessageValueException
MessageValueException
- If the given object can't be converted
into a double value.public static char toChar(Object value) throws MessageValueException
MessageValueException
- If the given object can't be converted
into a char value.public static byte[] toBytes(Object value) throws MessageValueException
MessageValueException
- If the given object can't be converted
into a bytes array.Copyright © 2013 ScalAgent D.T.. All Rights Reserved.