Package nz.org.riskscape.engine
Class CoercingFunctionWrapper
java.lang.Object
nz.org.riskscape.engine.CoercingFunctionWrapper
- All Implemented Interfaces:
AutoCloseable,nz.org.riskscape.engine.function.RiskscapeFunction,nz.org.riskscape.engine.function.UntypedFunction
public class CoercingFunctionWrapper
extends Object
implements nz.org.riskscape.engine.function.RiskscapeFunction
-
Field Summary
Fields inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction
BUILT_IN, LOG -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()List<nz.org.riskscape.engine.types.Type>nz.org.riskscape.engine.types.Typenz.org.riskscape.engine.function.RiskscapeFunctiontoString()static nz.org.riskscape.engine.function.RiskscapeFunctionwrap(nz.org.riskscape.engine.function.RiskscapeFunction wrapped, List<Optional<nz.org.riskscape.engine.types.eqrule.Coercer>> coercers) Return aRiskscapeFunctionthat wraps another function to apply anyCoercers to the input arguments before passing them to the wrapped function.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface nz.org.riskscape.engine.function.RiskscapeFunction
builtin, getAggregationFunction, getArguments, getOverloaded, getRealizable, getTypesFromArguments, identified, identified, isA, setProblemReporter, validate
-
Method Details
-
wrap
public static nz.org.riskscape.engine.function.RiskscapeFunction wrap(nz.org.riskscape.engine.function.RiskscapeFunction wrapped, List<Optional<nz.org.riskscape.engine.types.eqrule.Coercer>> coercers) Return a
RiskscapeFunctionthat wraps another function to apply anyCoercers to the input arguments before passing them to the wrapped function. This function advertises argument types based on the coercer's source type, falling back to the wrapped function's original advertised type if no coercer was present for that argument. -
call
- Specified by:
callin interfacenz.org.riskscape.engine.function.UntypedFunction
-
getReturnType
public nz.org.riskscape.engine.types.Type getReturnType()- Specified by:
getReturnTypein interfacenz.org.riskscape.engine.function.RiskscapeFunction
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfacenz.org.riskscape.engine.function.RiskscapeFunction
-
toString
-
getCoercers
-
getWrapped
public nz.org.riskscape.engine.function.RiskscapeFunction getWrapped() -
getArgumentTypes
- Specified by:
getArgumentTypesin interfacenz.org.riskscape.engine.function.RiskscapeFunction
-