Interface ValueConverter<T>

Type Parameters:
T - output type
All Known Implementing Classes:
DefaultValueConverter, DefaultValueConverter.BooleanConverter, DefaultValueConverter.CaseInsensitiveRegexConverter, DefaultValueConverter.EpochTimestampConverter, DefaultValueConverter.GenericDateTimeConverter, DefaultValueConverter.LocalDateConverter, DefaultValueConverter.LocalDateTimeConverter, DefaultValueConverter.NumberConverter, DefaultValueConverter.RegexConverter, DefaultValueConverter.StringConverter, DefaultValueConverter.ZonedDateTimeConverter
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ValueConverter<T>
Author:
Jared Wiltshire
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(String textValue)
    Converts a string value to its Java representation
    default T
    convert(String type, String textValue)
     
  • Method Details

    • convert

      T convert(String textValue)
      Converts a string value to its Java representation
      Parameters:
      textValue - percent-decoded value string (e.g. john, 2015-01-01 or 30)
      Returns:
      converted value
      Throws:
      ConverterException - if converter encountered error while converting
    • convert

      default T convert(String type, String textValue)
      Parameters:
      type - percent-decoded type, used to interpret input string (e.g. string, date or number)
      textValue - percent-decoded value string (e.g. john, 2015-01-01 or 30)
      Returns:
      converted value
      Throws:
      ConverterException - if converter encountered error while converting