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 Details

    • toLong

      @NotNull @NotNull Long toLong()
      Convert to Long.
      Returns:
      Long representation of the converted value
      Throws:
      NumberFormatException - if the conversion fails
    • toByte

      @NotNull @NotNull Byte toByte()
      Convert to Byte.
      Returns:
      Byte representation of the converted value
      Throws:
      NumberFormatException - if the conversion fails
    • toShort

      @NotNull @NotNull Short toShort()
      Convert to Short.
      Returns:
      Short representation of the converted value
      Throws:
      NumberFormatException - if the conversion fails
    • toInteger

      @NotNull @NotNull Integer toInteger()
      Convert to Integer.
      Returns:
      Integer representation of the converted value
      Throws:
      NumberFormatException - if the conversion fails
    • toDouble

      @NotNull @NotNull Double toDouble()
      Convert to Double.
      Returns:
      Double representation of the converted value
      Throws:
      NumberFormatException - if the conversion fails
    • toFloat

      @NotNull @NotNull Float toFloat()
      Convert to Float.
      Returns:
      Float representation of the converted value
      Throws:
      NumberFormatException - if the conversion fails
    • toZonedDateTime

      @NotNull @NotNull ZonedDateTime toZonedDateTime()
      Convert to ZonedDateTime.
      Returns:
      Calendar representation of the converted value
      Throws:
      IllegalArgumentException - if the value cannot be parsed into a calendar
    • toCalendar

      @NotNull @NotNull Calendar toCalendar()
      Convert to Calendar.
      Returns:
      Calendar representation of the converted value
      Throws:
      IllegalArgumentException - if the value cannot be parsed into a calendar
    • toDate

      @NotNull @NotNull Date toDate()
      Convert to Date.
      Returns:
      Date representation of the converted value
      Throws:
      IllegalArgumentException - if the value cannot be parsed into a date
    • toBoolean

      @NotNull @NotNull Boolean toBoolean()
      Convert to boolean.
      Returns:
      Boolean representation of the converted value
    • toBigDecimal

      @NotNull @NotNull BigDecimal toBigDecimal()
      Convert to BigDecimal.
      Returns:
      BigDecimal representation of the converted value
      Throws:
      NumberFormatException - if the conversion fails