Class StructCasterLoose
java.lang.Object
ortus.boxlang.runtime.dynamic.casters.StructCasterLoose
- All Implemented Interfaces:
IBoxCaster
I handle casting anything to a Struct, except I'll also cast any Java classes which are not a built in datatype into a struct, using the public
fields as the keys and the values as the values.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CastAttempt<IStruct> Tests to see if the value can be cast to a Struct.static IStructUsed to cast anything to a Struct, throwing exception if we failstatic IStructUsed to cast anything to a Struct
-
Constructor Details
-
StructCasterLoose
public StructCasterLoose()
-
-
Method Details
-
attempt
Tests to see if the value can be cast to a Struct. 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 Struct- Returns:
- The Struct value
-
cast
Used to cast anything to a Struct, throwing exception if we fail- Parameters:
object- The value to cast to a Struct- Returns:
- The Struct value
-
cast
Used to cast anything to a Struct- Parameters:
object- The value to cast to a Structfail- True to throw exception when failing.- Returns:
- The Struct value
-