Interface Coercer

All Superinterfaces:
Function<Object,Object>

public interface Coercer extends Function<Object,Object>

A function for transforming a value from one RiskScape type to another

  • Method Details

    • build

      static Coercer build(Type source, Type target, Function<Object,Object> function)
    • identity

      static Coercer identity(Type type)
    • apply

      Object apply(Object source)
      Specified by:
      apply in interface Function<Object,Object>
    • getSourceType

      Type getSourceType()
      Returns:
      The type of value this function accepts
    • getTargetType

      Type getTargetType()
      Returns:
      the type of value this function returns
    • isIdentity

      boolean isIdentity()
      Returns:
      true if this coercer will be an identity coerce, E.g a no-op coercer