Class ObjectConverter


  • @Converter(generateLoader=true)
    public final class ObjectConverter
    extends Object
    Some core java.lang based Type Converters
    • 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
      • toByte

        @Converter
        public static Byte toByte​(String value)
      • toCharArray

        @Converter
        public static char[] toCharArray​(String value)
      • toCharacter

        @Converter
        public static Character toCharacter​(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
      • toShort

        @Converter
        public static Short toShort​(String value)
      • toInteger

        @Converter(allowNull=true)
        public static Integer toInteger​(Number value)
        Returns the converted value, or null if the value is null
      • toInteger

        @Converter
        public static Integer toInteger​(String value)
      • toLong

        @Converter(allowNull=true)
        public static Long toLong​(Number value)
        Returns the converted value, or null if the value is null
      • toLong

        @Converter
        public static Long toLong​(String value)
      • 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
      • toFloat

        @Converter
        public static Float toFloat​(String value)
      • toDouble

        @Converter
        public static Double toDouble​(Number value)
        Returns the converted value, or null if the value is null
      • toDouble

        @Converter
        public static Double toDouble​(String value)
      • toString

        @Converter
        public static String toString​(Integer value)
      • toString

        @Converter
        public static String toString​(Long value)
      • toString

        @Converter
        public static String toString​(Boolean value)
      • toBoolean

        @Converter
        public static Boolean toBoolean​(String value)