Class ConversionUtils


  • public final class ConversionUtils
    extends Object
    • Method Detail

      • toInt

        public static Optional<Integer> toInt​(Optional<Object> valueOptional)
        Converts the provided value to an Integer if possible.
        Parameters:
        valueOptional - - Optional containing value to convert to Integer
        Returns:
        Optional containing an Integer or empty if a value is not present or cannot be converted
      • toLong

        public static Optional<Long> toLong​(Optional<Object> valueOptional)
        Converts the provided value to an Long if possible.
        Parameters:
        valueOptional - Optional parameter to convert to Long
        Returns:
        Optional containing a Long value or empty if the parameter cannot be converted
      • toDouble

        public static Optional<Double> toDouble​(Optional<Object> valueOptional)
        Converts the provided value to an Double if possible.
        Parameters:
        valueOptional - Optional parameter to convert to Long
        Returns:
        Optional containing a Double value or empty if the parameter cannot be converted