Interface Convertible<A>

Type Parameters:
A - the value type
All Known Subinterfaces:
CookieParameter, JWTClaimsSet.Claim, LDAPAttribute, Parameter, SetCookieParameter

public interface Convertible<A>

Represents a value of a given type that can be converted.

Since:
1.5
Author:
Jeremy Kuhn
  • Method Details

    • getName

      String getName()

      Returns the name.

      Returns:
      a name
    • getValue

      A getValue()

      Returns the raw value.

      Returns:
      a raw value
    • as

      <T> T as(Class<T> type)

      Converts the value to the specified type.

      Type Parameters:
      T - the target type
      Parameters:
      type - a class of type T
      Returns:
      the converted value or null
    • as

      <T> T as(Type type)

      Converts the value to the specified type.

      Type Parameters:
      T - the target type
      Parameters:
      type - the target type
      Returns:
      the converted value or null
    • asArrayOf

      <T> T[] asArrayOf(Class<T> type)

      Converts the value to an array of the specified type.

      Type Parameters:
      T - the target component type
      Parameters:
      type - a class of type T
      Returns:
      the value converted to an array of T or null
    • asArrayOf

      <T> T[] asArrayOf(Type type)

      Converts the value to an array of the specified type.

      Type Parameters:
      T - the target component type
      Parameters:
      type - the target component type
      Returns:
      the value converted to an array of T or null
    • asListOf

      <T> List<T> asListOf(Class<T> type)

      Converts the value to a list of the specified type.

      Type Parameters:
      T - the target list argument type
      Parameters:
      type - a class of type T
      Returns:
      the value converted to a list of T or null
    • asListOf

      <T> List<T> asListOf(Type type)

      Converts the value to a list of the specified type.

      Type Parameters:
      T - the target list argument type
      Parameters:
      type - the target list argument type
      Returns:
      the value converted to a list of T or null
    • asSetOf

      <T> Set<T> asSetOf(Class<T> type)

      Converts the value to a set of the specified type.

      Type Parameters:
      T - the target set argument type
      Parameters:
      type - a class of type T
      Returns:
      the value converted to a set of T or null
    • asSetOf

      <T> Set<T> asSetOf(Type type)

      Converts the value to a set of the specified type.

      Type Parameters:
      T - the target set argument type
      Parameters:
      type - the target set argument type
      Returns:
      the value converted to a set of T or null
    • asByte

      Byte asByte()

      Converts the value to a byte.

      Returns:
      the converted value or null
    • asShort

      Short asShort()

      Converts the value to a short.

      Returns:
      the converted value or null
    • asInteger

      Integer asInteger()

      Converts the value to an integer.

      Returns:
      the converted value or null
    • asLong

      Long asLong()

      Converts the value to a long.

      Returns:
      the converted value or null
    • asFloat

      Float asFloat()

      Converts the value to a float.

      Returns:
      the converted value or null
    • asDouble

      Double asDouble()

      Converts the value to a double.

      Returns:
      the converted value or null
    • asCharacter

      Character asCharacter()

      Converts the value to a character.

      Returns:
      the converted value or null
    • asString

      String asString()

      Converts the value to a string.

      Returns:
      the converted value or null
    • asBoolean

      Boolean asBoolean()

      Converts the value to a boolean.

      Returns:
      the converted value or null
    • asBigInteger

      BigInteger asBigInteger()

      Converts the value to a big integer.

      Returns:
      the converted value or null
    • asBigDecimal

      BigDecimal asBigDecimal()

      Converts the value to a big decimal.

      Returns:
      the converted value or null
    • asLocalDate

      LocalDate asLocalDate()

      Converts the value to a local date.

      Returns:
      the converted value or null
    • asLocalDateTime

      LocalDateTime asLocalDateTime()

      Converts the value to a loca date time.

      Returns:
      the converted value or null
    • asZonedDateTime

      ZonedDateTime asZonedDateTime()

      Converts the value to a zoned date time.

      Returns:
      the converted value or null
    • asCurrency

      Currency asCurrency()

      Converts the value to a currency.

      Returns:
      the converted value or null
    • asLocale

      Locale asLocale()

      Converts the value to a locale.

      Returns:
      the converted value or null
    • asFile

      File asFile()

      Converts the value to a file.

      Returns:
      the converted value or null
    • asPath

      Path asPath()

      Converts the value to a path.

      Returns:
      the converted value or null
    • asURI

      URI asURI()

      Converts the value to a URI.

      Returns:
      the converted value or null
    • asURL

      URL asURL()

      Converts the value to a URL.

      Returns:
      the converted value or null
    • asPattern

      Pattern asPattern()

      Converts the value to a pattern.

      Returns:
      the converted value or null
    • asInetAddress

      InetAddress asInetAddress()

      Converts the value to an inet address.

      Returns:
      the converted value or null
    • asClass

      Class<?> asClass()

      Converts the value to a class.

      Returns:
      the converted value or null