Class Attribute

  • All Implemented Interfaces:
    java.io.Serializable

    public class Attribute
    extends java.lang.Object
    implements java.io.Serializable
    Pojo which represents an attribute. Attribute can have sub attributes e.g. for localized attributes there can be specified attribute for specific language where getIsoCode() will be define locale iso code. If attribute is sub attribute it should point to it's parent getParent() and should be defined in parent's getSubAttributes()
    See Also:
    Serialized Form
    • Constructor Detail

      • Attribute

        public Attribute​(java.lang.String qualifier,
                         java.lang.String displayName,
                         boolean mandatory)
        Creates an attribute
        Parameters:
        qualifier - qualifier of the attribute
        displayName - display name of the attribute
        mandatory - tells if attribute is mandatory - cannot be moved.
      • Attribute

        public Attribute​(java.lang.String qualifier,
                         java.lang.String displayName,
                         java.lang.String isoCode,
                         boolean mandatory)
        Creates an attribute
        Parameters:
        qualifier - qualifier of the attribute
        displayName - display name of the attribute
        isoCode - iso code e.g. locale
        mandatory - tells if attribute is mandatory - cannot be moved.
      • Attribute

        public Attribute​(Attribute parent,
                         java.lang.String isoCode)
        Creates sub attribute of given parent.
        Parameters:
        parent - parent.
        isoCode - iso code e.g. locale
      • Attribute

        public Attribute​(Attribute toCopy)
        Creates copy of an attribute. without making a copy of parent.
        Parameters:
        toCopy - attribute to copy.
    • Method Detail

      • getDisplayName

        public java.lang.String getDisplayName()
      • setDisplayName

        public void setDisplayName​(java.lang.String displayName)
      • getQualifier

        public java.lang.String getQualifier()
      • setQualifier

        public void setQualifier​(java.lang.String qualifier)
      • isMandatory

        public boolean isMandatory()
      • setMandatory

        public void setMandatory​(boolean mandatory)
      • getIsoCode

        public java.lang.String getIsoCode()
      • setIsoCode

        public void setIsoCode​(java.lang.String isoCode)
      • getSubAttributes

        public java.util.Set<Attribute> getSubAttributes()
      • setSubAttributes

        public void setSubAttributes​(java.util.Set<Attribute> subAttributes)
      • hasSubAttributes

        public boolean hasSubAttributes()
      • setParent

        public void setParent​(Attribute newParent)
        Sets new parent and adds this attribute to parent's sub attributes.
        Parameters:
        newParent - new parent of the attribute.
      • addSubAttribute

        public void addSubAttribute​(Attribute attribute)
        Adds sub attribute of this attribute and sets attribute's parent to this.
        Parameters:
        attribute - sub attribute.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getAllParents

        public java.util.List<Attribute> getAllParents()
        Lists parents to first attribute which does not have parent. This attribute's parent will be first on the list.
        Returns:
        list of all parents.