Interface DescriptionMapper<T>

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 DescriptionMapper<T>
Some command systems already provide some kind of abstraction for descriptions. So this interface is used to map these descriptions to the common DescriptionFacade.
  • Method Summary

    Modifier and Type
    Method
    Description
    map(T describable)
    Maps a describable object to a description facade.
    static <T> DescriptionMapper<T>
    text(Function<T,String> extractor)
    Maps a describable object to a text description by extracting the text from it.
  • Method Details

    • text

      static <T> DescriptionMapper<T> text(Function<T,String> extractor)
      Maps a describable object to a text description by extracting the text from it.
      Type Parameters:
      T - the type of the describable object
      Parameters:
      extractor - the function to extract the text from the describable object
      Returns:
      the created description mapper
    • map

      DescriptionFacade map(T describable)
      Maps a describable object to a description facade.
      Parameters:
      describable - the describable object
      Returns:
      the created description facade