Class IdentifiableObject

java.lang.Object
org.hisp.dhis.model.IdentifiableObject
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Dimension, Me, NameableObject, OptionSet, OrgUnitLevel, Period, ProgramTrackedEntityAttribute, TableHook

public class IdentifiableObject extends Object implements Serializable
See Also:
  • Field Details

    • id

      protected String id
    • code

      protected String code
    • name

      protected String name
    • created

      protected Date created
    • lastUpdated

      protected Date lastUpdated
    • attributeValues

      protected Set<AttributeValue> attributeValues
  • Constructor Details

    • IdentifiableObject

      public IdentifiableObject()
  • Method Details

    • addAttributeValue

      public boolean addAttributeValue(AttributeValue attributeValue)
      Adds an attribute value.
      Parameters:
      attributeValue - the AttributeValue.
      Returns:
      true if this set did not already contain the attribute value.
    • updateAttributeValue

      public void updateAttributeValue(AttributeValue attributeValue)
      Updates an attribute value. Removes an existing attribute value if necessary before adding the given attribute value.
      Parameters:
      attributeValue - the AttributeValue.
    • getAttributeValue

      public AttributeValue getAttributeValue(String attribute)
      Returns the attribute value with the given attribute identifier.
      Parameters:
      attribute - the attribute identifier.
      Returns:
      the attribute value with the given attribute identifier, or null.
    • hasAttributeValue

      public boolean hasAttributeValue(String attribute)
      Indicates whether an attribute value exists for the given attribute identifier.
      Parameters:
      attribute - the attribute identifier.
      Returns:
      true of an attribute value exists.
    • getAttributeValueAsString

      public String getAttributeValueAsString(String attribute)
      Returns the attribute value with the given attribute identifier as a string.
      Parameters:
      attribute - the attribute identifier.
      Returns:
      the attribute value with the given attribute identifier, or null.
    • removeAttributeValue

      public boolean removeAttributeValue(String attribute)
      Removes the attribute value with the given attribute identifier.
      Parameters:
      attribute - the attribute identifier.
      Returns:
      true if an attribute value was removed.
    • clearAttributeValues

      public void clearAttributeValues()
      Removes all attribute values.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object