Interface Formatter<T>

  • Field Details

  • Method Details

    • getType

      Class<? extends T> getType()
      Returns the type of the formatted object.
      Returns:
      the type of the formatted object.
    • parse

      T parse(String value)
      Parses the key from the specified string.
      Parameters:
      value - a string representation of the key
      Returns:
      the parsed key
    • format

      String format(T value)
      Formats the specified key to a string representation.
      Parameters:
      value - a key to format
      Returns:
      a string representation of the specified key.
    • wrap

      default <U> Formatter<U> wrap(Class<? extends U> type, Function<U,T> unwrapper, Function<T,U> wrapper)
      Returns a wrapped formatter.
      Type Parameters:
      U - the wrapped type
      Parameters:
      type - the wrapped type
      unwrapper - the unwrapper function
      wrapper - the wrapper function
      Returns:
      a wrapped formmater
    • of

      static <T> Formatter<T> of(T value)
    • joining

      static <T, V1, V2> Formatter<T> joining(Class<? extends T> type, String delimiter, Formatter<V1> formatter1, Formatter<V2> formatter2, Function<T,V1> unwrapper1, Function<T,V2> unwrapper2, BiFunction<V1,V2,T> wrapper)
    • joining

      static <T> Formatter<T> joining(Class<? extends T> type, String delimiter, Function<T,String[]> unwrapper, Function<String[],T> wrapper)