Class LongCaster

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

public class LongCaster extends Object implements IBoxCaster
I handle casting anything
  • Constructor Details

    • LongCaster

      public LongCaster()
  • Method Details

    • attempt

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

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

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

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

      public static Long cast(boolean allowTruncate, Object object, Boolean fail)
      Used to cast anything
      Parameters:
      object - The value to cast
      fail - True to throw exception when failing.
      Returns:
      The value, or null when cannot be cast