Class KeyCaster

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

public class KeyCaster extends Object implements IBoxCaster
I handle casting anything to a Key
  • Constructor Details

    • KeyCaster

      public KeyCaster()
  • Method Details

    • attempt

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

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

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