Interface Converter
- All Known Implementing Classes:
BooleanConverter,CalendarConverter,DateConverter,NumberConverter,StringConverter,ZonedDateTimeConverter
public interface Converter
A converter converts a value to a specific target type.
-
Method Summary
Modifier and TypeMethodDescription@NotNull BigDecimalConvert to BigDecimal.@NotNull BooleanConvert to boolean.@NotNull BytetoByte()Convert to Byte.@NotNull CalendarConvert to Calendar.@NotNull DatetoDate()Convert to Date.@NotNull DoubletoDouble()Convert to Double.@NotNull FloattoFloat()Convert to Float.@NotNull IntegerConvert to Integer.@NotNull LongtoLong()Convert to Long.@NotNull ShorttoShort()Convert to Short.@NotNull ZonedDateTimeConvert to ZonedDateTime.
-
Method Details
-
toLong
Convert to Long.- Returns:
- Long representation of the converted value
- Throws:
NumberFormatException- if the conversion fails
-
toByte
Convert to Byte.- Returns:
- Byte representation of the converted value
- Throws:
NumberFormatException- if the conversion fails
-
toShort
Convert to Short.- Returns:
- Short representation of the converted value
- Throws:
NumberFormatException- if the conversion fails
-
toInteger
Convert to Integer.- Returns:
- Integer representation of the converted value
- Throws:
NumberFormatException- if the conversion fails
-
toDouble
Convert to Double.- Returns:
- Double representation of the converted value
- Throws:
NumberFormatException- if the conversion fails
-
toFloat
Convert to Float.- Returns:
- Float representation of the converted value
- Throws:
NumberFormatException- if the conversion fails
-
toZonedDateTime
Convert to ZonedDateTime.- Returns:
- Calendar representation of the converted value
- Throws:
IllegalArgumentException- if the value cannot be parsed into a calendar
-
toCalendar
Convert to Calendar.- Returns:
- Calendar representation of the converted value
- Throws:
IllegalArgumentException- if the value cannot be parsed into a calendar
-
toDate
Convert to Date.- Returns:
- Date representation of the converted value
- Throws:
IllegalArgumentException- if the value cannot be parsed into a date
-
toBoolean
Convert to boolean.- Returns:
- Boolean representation of the converted value
-
toBigDecimal
Convert to BigDecimal.- Returns:
- BigDecimal representation of the converted value
- Throws:
NumberFormatException- if the conversion fails
-