Class ConversionHelper
- java.lang.Object
-
- org.objectweb.joram.shared.messages.ConversionHelper
-
public class ConversionHelper extends Object
TheConversionHelperclass is used for converting values carried by messages into specified types, if possible.
-
-
Constructor Summary
Constructors Constructor Description ConversionHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleantoBoolean(Object value)Gets the boolean value of the given object.static bytetoByte(Object value)Gets the byte value of the given object.static byte[]toBytes(Object value)Gets the bytes value of the given object.static chartoChar(Object value)Gets the char value of the given object.static doubletoDouble(Object value)Gets the double value of the given object.static floattoFloat(Object value)Gets the float value of the given object.static inttoInt(Object value)Gets the int value of the given object.static longtoLong(Object value)Gets the long value of the given object.static shorttoShort(Object value)Gets the short value of the given object.static StringtoString(Object value)Gets the String value of the given object.
-
-
-
Method Detail
-
toBoolean
public static boolean toBoolean(Object value) throws MessageValueException
Gets the boolean value of the given object.- Throws:
MessageValueException- If the given object can't be converted into a boolean value.
-
toByte
public static byte toByte(Object value) throws MessageValueException
Gets the byte value of the given object.- Throws:
MessageValueException- If the given object can't be converted into a byte value.
-
toShort
public static short toShort(Object value) throws MessageValueException
Gets the short value of the given object.- Throws:
MessageValueException- If the given object can't be converted into a short value.
-
toInt
public static int toInt(Object value) throws MessageValueException
Gets the int value of the given object.- Throws:
MessageValueException- If the given object can't be converted into an int value.
-
toLong
public static long toLong(Object value) throws MessageValueException
Gets the long value of the given object.- Throws:
MessageValueException- If the given object can't be converted into a long value.
-
toFloat
public static float toFloat(Object value) throws MessageValueException
Gets the float value of the given object.- Throws:
MessageValueException- If the given object can't be converted into a float value.
-
toDouble
public static double toDouble(Object value) throws MessageValueException
Gets the double value of the given object.- Throws:
MessageValueException- If the given object can't be converted into a double value.
-
toChar
public static char toChar(Object value) throws MessageValueException
Gets the char value of the given object.- Throws:
MessageValueException- If the given object can't be converted into a char value.
-
toBytes
public static byte[] toBytes(Object value) throws MessageValueException
Gets the bytes value of the given object.- Throws:
MessageValueException- If the given object can't be converted into a bytes array.
-
-