Class ArrayCaster

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

public class ArrayCaster extends Object implements IBoxCaster
I handle casting anything to a Array
  • Constructor Details

    • ArrayCaster

      public ArrayCaster()
  • Method Details

    • attempt

      public static CastAttempt<Array> attempt(Object object)
      Tests to see if the value can be cast to an Array. Returns a CastAttempt<T> which will contain the result if casting was successfull , or can be interrogated to proceed otherwise.
      Parameters:
      object - The value to cast to an Array
      Returns:
      The Array value
    • cast

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

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