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 BigDecimal
Convert to BigDecimal.@NotNull Boolean
Convert to boolean.@NotNull Byte
toByte()
Convert to Byte.@NotNull Calendar
Convert to Calendar.@NotNull Date
toDate()
Convert to Date.@NotNull Double
toDouble()
Convert to Double.@NotNull Float
toFloat()
Convert to Float.@NotNull Integer
Convert to Integer.@NotNull Long
toLong()
Convert to Long.@NotNull Short
toShort()
Convert to Short.@NotNull ZonedDateTime
Convert 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
-