Class CollectionCaster
java.lang.Object
ortus.boxlang.runtime.dynamic.casters.CollectionCaster
- All Implemented Interfaces:
IBoxCaster
I handle casting anything to a collection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CastAttempt<Collection<Object>> Tests to see if the value can be cast to a collection.static Collection<Object> Used to cast anything to a collection, throwing exception if we failstatic Collection<Object> Used to cast anything to a collection
-
Constructor Details
-
CollectionCaster
public CollectionCaster()
-
-
Method Details
-
attempt
Tests to see if the value can be cast to a collection. 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 collection- Returns:
- The collection value
-
cast
Used to cast anything to a collection, throwing exception if we fail- Parameters:
object- The value to cast to a collection- Returns:
- The collection value
-
cast
Used to cast anything to a collection- Parameters:
object- The value to cast to a collectionfail- True to throw exception when failing.- Returns:
- The collection value
-