Interface Convertlet<F,T>

All Known Subinterfaces:
FinalConvertlet<F,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 Convertlet<F,T>
A Convertlet provides a single conversion from an object of a certain type to an object of a different type.

Convertlets are provided by ConversionProvider in an ArooaDescriptor.

Convertlets are used in sequences. A conversion from Float to Integer uses to Convertlets. Float to Number and Number to Integer. If a convertlet isn't to be used as part of a sequence it should be declared as a FinalConvertlet.

A Convertlet can always assume that they will not be used for an inappropriate conversion and so do not have to do any type checking.

Author:
rob
  • Method Summary

    Modifier and Type
    Method
    Description
    convert(F from)
    Convert from one thing to another.
  • Method Details

    • convert

      T convert(F from) throws ArooaConversionException
      Convert from one thing to another.
      Parameters:
      from - The from object, never null.
      Returns:
      The conversion. Can be null.
      Throws:
      ArooaConversionException - If conversion failed - for instance a number or date can't be parsed.