Class FunctionalTransformer<E,W>

All Implemented Interfaces:

public class FunctionalTransformer<E,W> extends AbstractTransformer<E,W>
A functional transformer performs bi-directional conversion via provided reciprocal functions.

TODO: Add a one-way transformer that uses a single function and does not support inversion (and would thus fail most/all modifications)? This would provide for a one-way wrapper behavior similar to other one-way wrapper-based transformers (such as Guava).

AO Industries, Inc.
  • Field Details

    • toWrapped

      protected final Function<? super E,? extends W> toWrapped
    • fromWrapped

      protected final Function<? super W,? extends E> fromWrapped
  • Constructor Details

    • FunctionalTransformer

      public FunctionalTransformer(Class<E> eClass, Class<W> wClass, Function<? super E,? extends W> toWrapped, Function<? super W,? extends E> fromWrapped)
      Creates a new bi-directional functional transformer.
      eClass - The wrapper type
      wClass - The wrapped type
      toWrapped - Converts from wrapper to wrapped type
      fromWrapped - Converts from wrapped to wrapper type
  • Method Details