- java.lang.Object
-
- io.annot8.common.utils.java.ConversionUtils
-
public final class ConversionUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Optional<Double>toDouble(Optional<Object> valueOptional)Converts the provided value to an Double if possible.static Optional<Integer>toInt(Optional<Object> valueOptional)Converts the provided value to an Integer if possible.static Optional<Long>toLong(Optional<Object> valueOptional)Converts the provided value to an Long if possible.
-
-
-
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
-
-