Class Attribute
- java.lang.Object
-
- com.hybris.backoffice.attributechooser.Attribute
-
- All Implemented Interfaces:
java.io.Serializable
public class Attribute extends java.lang.Object implements java.io.SerializablePojo which represents an attribute. Attribute can have sub attributes e.g. for localized attributes there can be specified attribute for specific language wheregetIsoCode()will be define locale iso code. If attribute is sub attribute it should point to it's parentgetParent()and should be defined in parent'sgetSubAttributes()- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Attribute(Attribute toCopy)Creates copy of an attribute.Attribute(Attribute parent, java.lang.String isoCode)Creates sub attribute of given parent.Attribute(java.lang.String qualifier, java.lang.String displayName, boolean mandatory)Creates an attributeAttribute(java.lang.String qualifier, java.lang.String displayName, java.lang.String isoCode, boolean mandatory)Creates an attribute
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSubAttribute(Attribute attribute)Adds sub attribute of this attribute and sets attribute's parent to this.booleanequals(java.lang.Object o)java.util.List<Attribute>getAllParents()Lists parents to first attribute which does not have parent.java.lang.StringgetDisplayName()java.lang.StringgetIsoCode()AttributegetParent()java.lang.StringgetQualifier()java.util.Set<Attribute>getSubAttributes()inthashCode()booleanhasSubAttributes()booleanisMandatory()voidsetDisplayName(java.lang.String displayName)voidsetIsoCode(java.lang.String isoCode)voidsetMandatory(boolean mandatory)voidsetParent(Attribute newParent)Sets new parent and adds this attribute to parent's sub attributes.voidsetQualifier(java.lang.String qualifier)voidsetSubAttributes(java.util.Set<Attribute> subAttributes)
-
-
-
Constructor Detail
-
Attribute
public Attribute(java.lang.String qualifier, java.lang.String displayName, boolean mandatory)Creates an attribute- Parameters:
qualifier- qualifier of the attributedisplayName- display name of the attributemandatory- 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 attributedisplayName- display name of the attributeisoCode- iso code e.g. localemandatory- 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()
-
getParent
public Attribute getParent()
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.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.
-
-