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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
List<nz.org.riskscape.engine.types.Type>
nz.org.riskscape.engine.types.Type
nz.org.riskscape.engine.function.RiskscapeFunction
toString()
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 aRiskscapeFunction
that wraps another function to apply anyCoercer
s 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, wait
Methods 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
RiskscapeFunction
that wraps another function to apply anyCoercer
s 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:
call
in interfacenz.org.riskscape.engine.function.UntypedFunction
-
getReturnType
public nz.org.riskscape.engine.types.Type getReturnType()- Specified by:
getReturnType
in interfacenz.org.riskscape.engine.function.RiskscapeFunction
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfacenz.org.riskscape.engine.function.UntypedFunction
-
toString
-
getCoercers
-
getWrapped
public nz.org.riskscape.engine.function.RiskscapeFunction getWrapped() -
getArgumentTypes
- Specified by:
getArgumentTypes
in interfacenz.org.riskscape.engine.function.RiskscapeFunction
-