Package org.apache.camel.converter
Class ObjectConverter
- java.lang.Object
-
- org.apache.camel.converter.ObjectConverter
-
@Converter(generateLoader=true) public final class ObjectConverter extends Object
Some core java.lang based Type Converters
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
fromCharArray(char[] value)
static Iterable<?>
iterable(Object value)
Creates an iterable over the valuestatic Iterator<?>
iterator(Object value)
Creates an iterator over the valuestatic BigInteger
toBigInteger(Object value)
Returns the converted value, or null if the value is nullstatic boolean
toBool(Object value)
Converts the given value to a boolean, handling strings or Boolean objects; otherwise returning false if the value could not be converted to a booleanstatic Boolean
toBoolean(Object value)
Converts the given value to a Boolean, handling strings or Boolean objects; otherwise returning null if the value cannot be converted to a booleanstatic Boolean
toBoolean(String value)
static Byte
toByte(Number value)
Returns the converted value, or null if the value is nullstatic Byte
toByte(String value)
static char
toChar(String value)
static Character
toCharacter(String value)
static char[]
toCharArray(String value)
static Class<?>
toClass(String value, org.apache.camel.Exchange exchange)
Returns the converted value, or null if the value is nullstatic Double
toDouble(Number value)
Returns the converted value, or null if the value is nullstatic Double
toDouble(String value)
static Float
toFloat(Number value)
Returns the converted value, or null if the value is nullstatic Float
toFloat(String value)
static Integer
toInteger(Number value)
Returns the converted value, or null if the value is nullstatic Integer
toInteger(String value)
static Long
toLong(Number value)
Returns the converted value, or null if the value is nullstatic Long
toLong(String value)
static Short
toShort(Number value)
Returns the converted value, or null if the value is nullstatic Short
toShort(String value)
static String
toString(Boolean value)
static String
toString(Integer value)
static String
toString(Long value)
static String
toString(StringBuffer value)
static String
toString(StringBuilder value)
-
-
-
Method Detail
-
toBool
@Converter public static boolean toBool(Object value)
Converts the given value to a boolean, handling strings or Boolean objects; otherwise returning false if the value could not be converted to a boolean
-
toBoolean
@Converter public static Boolean toBoolean(Object value)
Converts the given value to a Boolean, handling strings or Boolean objects; otherwise returning null if the value cannot be converted to a boolean
-
iterator
@Converter public static Iterator<?> iterator(Object value)
Creates an iterator over the value
-
iterable
@Converter public static Iterable<?> iterable(Object value)
Creates an iterable over the value
-
toByte
@Converter(allowNull=true) public static Byte toByte(Number value)
Returns the converted value, or null if the value is null
-
toCharArray
@Converter public static char[] toCharArray(String value)
-
toChar
@Converter public static char toChar(String value)
-
fromCharArray
@Converter public static String fromCharArray(char[] value)
-
toClass
@Converter public static Class<?> toClass(String value, org.apache.camel.Exchange exchange)
Returns the converted value, or null if the value is null
-
toShort
@Converter(allowNull=true) public static Short toShort(Number value)
Returns the converted value, or null if the value is null
-
toInteger
@Converter(allowNull=true) public static Integer toInteger(Number value)
Returns the converted value, or null if the value is null
-
toLong
@Converter(allowNull=true) public static Long toLong(Number value)
Returns the converted value, or null if the value is null
-
toBigInteger
@Converter(allowNull=true) public static BigInteger toBigInteger(Object value)
Returns the converted value, or null if the value is null
-
toFloat
@Converter public static Float toFloat(Number value)
Returns the converted value, or null if the value is null
-
toDouble
@Converter public static Double toDouble(Number value)
Returns the converted value, or null if the value is null
-
toString
@Converter public static String toString(StringBuffer value)
-
toString
@Converter public static String toString(StringBuilder value)
-
-