Class NullSafeFunction

java.lang.Object
nz.org.riskscape.engine.function.NullSafeFunction
All Implemented Interfaces:
AutoCloseable, RiskscapeFunction, UntypedFunction

public class NullSafeFunction extends Object implements RiskscapeFunction

A RiskscapeFunction that wraps another one to short-circuit the target function to return null if any of the args are null.

  • Constructor Details

    • NullSafeFunction

      protected NullSafeFunction(RiskscapeFunction target, List<Type> argumentTypes, Type returnType, boolean[] notNullableIndices)

      Creates a new NullSafeFunction instance.

      Parameters:
      target -
      argumentTypes -
      returnType -
      notNullableIndices - for each argument, records true if the original receiver is not nullable
  • Method Details