Class Rule<F,​T>

  • Type Parameters:
    F - The type to convert from.
    T - The type to convert to.
    All Implemented Interfaces:
    TargetRule

    public abstract class Rule<F,​T>
    extends java.lang.Object
    implements TargetRule
    A rule implementation that works by capturing the type arguments via subclassing. The rule supports specifying both from and to types. Filtering on the from by the Rule implementation. Filtering on the to is done by the converter customization mechanism.
    • Constructor Summary

      Constructors 
      Constructor Description
      Rule​(Function<F,​T> func)
      Create an instance with a conversion function.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ConverterFunction getFunction()
      The function to perform the conversion.
      java.lang.reflect.Type getTargetType()
      The target type of this rule.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Rule

        public Rule​(Function<F,​T> func)
        Create an instance with a conversion function.
        Parameters:
        func - The conversion function to use.
    • Method Detail

      • getTargetType

        public java.lang.reflect.Type getTargetType()
        Description copied from interface: TargetRule
        The target type of this rule. The conversion function is invoked for each conversion to the target type.
        Specified by:
        getTargetType in interface TargetRule
        Returns:
        The target type.