Class FunctionCaster
java.lang.Object
ortus.boxlang.runtime.dynamic.casters.FunctionCaster
- All Implemented Interfaces:
IBoxCaster
I handle casting anything to a Function
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CastAttempt<Function> Tests to see if the value can be cast to a Function.static CastAttempt<Function> Tests to see if the value can be cast to a Function.static FunctionUsed to cast anything to a Function, throwing exception if we failstatic FunctionUsed to cast anything to a Functionstatic FunctionUsed to cast anything to a Function, throwing exception if we failstatic FunctionUsed to cast anything to a Functionstatic StringgetSAMName(Object object, String SAMClass) I detect if an instance implements a known FI or a SAM and return the name of the method, null if not a SAM.
-
Constructor Details
-
FunctionCaster
public FunctionCaster()
-
-
Method Details
-
attempt
Tests to see if the value can be cast to a Function. Returns aCastAttempt<T>which will contain the result if casting was was successfull, or can be interogated to proceed otherwise.- Parameters:
object- The value to cast to a Function- Returns:
- The Function value
-
attempt
Tests to see if the value can be cast to a Function. Returns aCastAttempt<T>which will contain the result if casting was was successfull, or can be interogated to proceed otherwise.- Parameters:
object- The value to cast to a Function- Returns:
- The Function value
-
cast
Used to cast anything to a Function, throwing exception if we fail- Parameters:
object- The value to cast to a FunctionSAMClass- The name of the SAM class the object is valid to cast to- Returns:
- The Function value
-
cast
Used to cast anything to a Function, throwing exception if we fail- Parameters:
object- The value to cast to a Function- Returns:
- The Function value
-
cast
Used to cast anything to a Function- Parameters:
object- The value to cast to a Functionfail- True to throw exception when failing.- Returns:
- The Function value, or null when cannot be cast
-
cast
Used to cast anything to a Function- Parameters:
object- The value to cast to a FunctionSAMClass- The name of the SAM class the object is valid to cast tofail- True to throw exception when failing.- Returns:
- The Function value, or null when cannot be cast
-
getSAMName
I detect if an instance implements a known FI or a SAM and return the name of the method, null if not a SAM.- Parameters:
object- The object to check- Returns:
- The name of the SAM method, or null if not a SAM
-