Class LocalObject

java.lang.Object
com.appiancorp.suiteapi.common.LocalObject
All Implemented Interfaces:
com.appiancorp.core.expr.portable.PortableLocalObject, DeepCloneable, LocalId, LocalStringId, Serializable, Cloneable, Comparable<LocalObject>
Direct Known Subclasses:
Contribution

public class LocalObject extends Object implements LocalId, LocalStringId, Serializable, DeepCloneable, Comparable<LocalObject>, com.appiancorp.core.expr.portable.PortableLocalObject
This class represents the base class for all first-class Appian Objects. It is used to represent objects with both Long and String ID's. At all times either the Long ID or the String ID is valid. LocalObject cannot have valid Id and StringId at the same time.
See Also:
  • Field Details

    • LOG

      protected static final org.slf4j.Logger LOG
  • Constructor Details

    • LocalObject

      public LocalObject()
      Constructor that constructs an empty local object.
    • LocalObject

      public LocalObject(LocalId o_)
      Constructor that constructs from a given LocalId object.
      Parameters:
      o_ - LocalId to construct the object from
    • LocalObject

      public LocalObject(LocalStringId o_)
      Constructor that constructs from a given LocalStringId object.
      Parameters:
      o_ - LocalStringId to construct the object from
    • LocalObject

      public LocalObject(Integer type_, Long id_)
      Constructor that constructs from a given type and id.
      Parameters:
      type_ - Use a constant from an ObjectTypeMapping.
      id_ - ID of type Long for object to constructor
    • LocalObject

      public LocalObject(Integer type_, String id_)
      Constructor that constructs from a type and String id.
      Parameters:
      type_ - Use a constant from an ObjectTypeMapping.
      id_ - String ID of the object to construct
  • Method Details

    • getId

      public Long getId()
      Returns the ID of this LocalObject.
      Specified by:
      getId in interface LocalId
      Specified by:
      getId in interface com.appiancorp.core.expr.portable.PortableLocalObject
      Returns:
      ID of this object
      See Also:
    • setId

      public void setId(Long p_)
      Sets the ID of this LocalObject.
      Specified by:
      setId in interface LocalId
      Parameters:
      p_ - ID to set
      See Also:
    • getType

      public Integer getType()
      Gets the type of this LocalObject. Should return a constant from ObjectTypeMapping.
      Specified by:
      getType in interface com.appiancorp.core.expr.portable.PortableLocalObject
      Returns:
      Type of this object
      See Also:
    • setType

      public void setType(Integer p_)
      Set the type of this LocalObject. Use a constant from ObjectTypeMapping.
      Parameters:
      p_ - Type of this object to set
      See Also:
    • getObjectTypeMapping

      public static LocalObjectTypeMapping getObjectTypeMapping()
      Get the mapping object used to determine a first-class object's type.
      Returns:
      Mapping class for determining object's type
      See Also:
    • setObjectTypeMapping

      public static void setObjectTypeMapping(LocalObjectTypeMapping p_)
      Set the mapper used to determine an first-class object's type.
      Parameters:
      p_ - Sets the mapping class used to determine object's type
      See Also:
    • getStringId

      public String getStringId()
      Returns the String Id of this LocalObject.
      Specified by:
      getStringId in interface LocalStringId
      Specified by:
      getStringId in interface com.appiancorp.core.expr.portable.PortableLocalObject
      Returns:
      Returns the string Id.
      See Also:
    • setStringId

      public void setStringId(String stringId_)
      Sets the String ID of this LocalObject.
      Specified by:
      setStringId in interface LocalStringId
      Parameters:
      stringId_ - The string Id to set.
      See Also:
    • equals

      public boolean equals(Object o_)
      Returns whether the LocalObject been passed is equal to this LocalObject.
      Overrides:
      equals in class Object
      Parameters:
      o_ - the reference object with which to compare.
      Returns:
      true if both objects are equal, otherwise false
    • hashCode

      public int hashCode()
      Returns a hash code value for the object. This method is supported for the benefit of hashtables such as those provided by Hashtable.
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object
    • toString

      public String toString()
      Returns a string representation of the LocalObject.In general, the toString method returns a string that "textually represents" this object.
      Overrides:
      toString in class Object
      Returns:
      String representation of the object
    • isNull

      public boolean isNull()
      A LocalObject may be null by containing a null type, or null object within the type.
      Returns:
      true if type or id/stringId is null
    • clone

      public Object clone()
      Creates and returns a copy of this object.
      Specified by:
      clone in interface DeepCloneable
      Overrides:
      clone in class Object
      Returns:
    • compareTo

      public int compareTo(LocalObject o)
      Compares the specified LocalObject with this LocalObject for ordering. Compares both types and then both ids or stringIds according to the types.
      Specified by:
      compareTo in interface Comparable<LocalObject>
      Parameters:
      o - the LocalObject to be compared.
      Returns:
      the value 0 if the argument LocalObject is equal to this LocalObject; a value less than 0 if this LocalObject is before the LocalObject argument; and a value greater than 0 if this LocalObject is after the LocalObject argument.
    • buildUserContext

      public static LocalObject[] buildUserContext(String userId)
      Builds the user context for a report.
      Parameters:
      userId - the user ID; cannot be null
      Returns:
      the user context for a report