Interface Mapping<A,​B>

  • Type Parameters:
    A - Class to map from
    B - Class to map to

    public interface Mapping<A,​B>
    Interface to allow mapping from one class to another class. For example, this could be used to map from a name to the upper case version of that name, or to the search case version of that name.
    • Field Detail

      • TO_US_LOWERCASE

        static final Mapping<String,​String> TO_US_LOWERCASE
        Map from a string to the lower case version of the string, in the US locale. Note If you want to look for the search name stored in the database, you should use TO_SEARCH_CASE instead.
      • TO_SEARCH_CASE

        static final Mapping<String,​String> TO_SEARCH_CASE
        Map from a string to the search case version of that string. This is equivalent to: com.redwood.scheduler.api.model.TextEscape.toSearchCase(original);
    • Method Detail

      • getIdentity

        static <T> Mapping<T,​T> getIdentity()
        Map from the object to itself.
        Returns:
        an identity mapping function
      • map

        B map​(A original)
        Perform a mapping from the original value to a new value.
        Parameters:
        original - the original value to map from
        Returns:
        the new value that is mapped to