Interface IFormatableObject<DATATYPE>

Type Parameters:
DATATYPE - Data type to be formatted
All Known Implementing Classes:
FormatableObject

public interface IFormatableObject<DATATYPE>
Basic interface for special objects having a certain string representation.
Author:
Philip Helger
  • Method Details

    • getValue

      @Nullable DATATYPE getValue()
      Get the original value.
      Returns:
      The unformatted value. May be null.
    • getFormatter

      @Nullable Function<? super DATATYPE,? extends String> getFormatter()
      Returns:
      The formatter to be used for formatting this object. Never null.
    • getAsString

      @Nullable default String getAsString()
      Get the value converted to a string with the specified formatter.
      Returns:
      the string representation of the value. May be null dependent on the semantics of the formatter.