Class ModifiableArrayCaster

java.lang.Object
ortus.boxlang.runtime.dynamic.casters.ModifiableArrayCaster
All Implemented Interfaces:
IBoxCaster

public class ModifiableArrayCaster extends Object implements IBoxCaster
I handle casting anything to a Array that needs to be modifiable This means I reject - Native Java arrays - ImmutableLists - UmmodifiableLists
  • Constructor Details

    • ModifiableArrayCaster

      public ModifiableArrayCaster()
  • Method Details

    • attempt

      public static CastAttempt<Array> attempt(Object object)
      Tests to see if the value can be cast to a Array. Returns a CastAttempt<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 Array
      Returns:
      The Array value
    • cast

      public static Array cast(Object object)
      Used to cast anything to a Array, throwing exception if we fail
      Parameters:
      object - The value to cast to a Array
      Returns:
      The Array value
    • cast

      public static Array cast(Object object, Boolean fail)
      Used to cast anything to a Array that needs to be modifiable
      Parameters:
      object - The value to cast to a Array
      fail - True to throw exception when failing.
      Returns:
      The Array value