Class ObjectHelper

java.lang.Object
de.uplanet.lucy.server.auxiliaries.ObjectHelper

@VelocityVariable("ObjectHelper") @VelocityCallable("singleton") public final class ObjectHelper extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    de.uplanet.lucy.server.dataobjects.IValueHolder<?>
     
    boolean
    Checks if the given argument is a boolean false, or null.
    boolean
    isNull(Object p_obj)
    Checks if the given argument is null.
    boolean
    Checks if the given argument is a boolean true, or null.
    boolean
    isVHNull(de.uplanet.lucy.server.dataobjects.IValueHolder<?> p_vh)
     
    boolean
    isVHNullOrEmpty(de.uplanet.lucy.server.dataobjects.IValueHolder<?> p_vh)
     
    orElse(Object p_obj, Object p_fallback)
    Checks if the given object reference is null, and returns either the object itself if it is not null, or the provided fallback value if the object reference is null.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ObjectHelper

      public ObjectHelper()
  • Method Details

    • isNull

      public boolean isNull(Object p_obj)
      Checks if the given argument is null.
      Parameters:
      p_obj - The value to be checked.
      Returns:
      true if the given value is null, or false otherwise.
    • orElse

      public Object orElse(Object p_obj, Object p_fallback)
      Checks if the given object reference is null, and returns either the object itself if it is not null, or the provided fallback value if the object reference is null.
      Parameters:
      p_obj - The object reference to check.
      p_fallback - The fallback value.
      Returns:
      The value of the object reference if it is not null, the fallback value otherwise.
      See Also:
    • isTrueOrNull

      public boolean isTrueOrNull(Object p_obj)
      Checks if the given argument is a boolean true, or null.
      Parameters:
      p_obj - A boolean value, or null.
      Returns:
      true if the given value is a boolean true or null, or false otherwise.
      Throws:
      IllegalArgumentException - If the given argument is neither a boolean value nor null.
    • isFalseOrNull

      public boolean isFalseOrNull(Object p_obj)
      Checks if the given argument is a boolean false, or null.
      Parameters:
      p_obj - A boolean value, or null.
      Returns:
      true if the given value is a boolean false or null, or false otherwise.
      Throws:
      IllegalArgumentException - If the given argument is neither a boolean value nor null.
    • getNull

      public Object getNull()
    • getNullValueHolder

      public de.uplanet.lucy.server.dataobjects.IValueHolder<?> getNullValueHolder()
    • isVHNull

      public boolean isVHNull(de.uplanet.lucy.server.dataobjects.IValueHolder<?> p_vh)
    • isVHNullOrEmpty

      public boolean isVHNullOrEmpty(de.uplanet.lucy.server.dataobjects.IValueHolder<?> p_vh)