Interface Formatter<T>

Type Parameters:
T - the type of object this can format
All Known Implementing Classes:
NumberFormatter, VariableFormatter

public interface Formatter<T>
Formats an object of some type into a string.
  • Method Summary

    Modifier and Type
    Method
    Description
    format(Object value)
    Formats the given value into a string representation.
    default String
    format(List<? extends T> values)
    Formats a list of values into a string representation.
    default String
    format(Stream<? extends T> values)
    Formats a stream of values into a string representation.
    Returns the class (or classes using inheritance) this formatter supports.
  • Method Details

    • getType

      Class<T> getType()
      Returns the class (or classes using inheritance) this formatter supports.
      Returns:
      the class
    • format

      String format(Object value)
      Formats the given value into a string representation.
      Parameters:
      value - the value
      Returns:
      the string representation
    • format

      default String format(List<? extends T> values)
      Formats a list of values into a string representation. The follows the same formatting as Arrays.toString(Object[]).
      Parameters:
      values - the list of values
      Returns:
      the string representation
    • format

      default String format(Stream<? extends T> values)
      Formats a stream of values into a string representation. The follows the same formatting as Arrays.toString(Object[]).
      Parameters:
      values - the stream of values
      Returns:
      the string representation