Class AttributeChooserForm
- java.lang.Object
-
- com.hybris.backoffice.attributechooser.AttributeChooserForm
-
- All Implemented Interfaces:
java.io.Serializable
public class AttributeChooserForm extends java.lang.Object implements java.io.SerializablePojo which is used to choose attributes. It hasgetAvailableAttributes()which contain attributes which can be chosen andgetChosenAttributes()which represents chosen attributes. IfisIncludeAll()is true then all attributes both from available and selected will be returned as selected throughgetSelectedAttributes()- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AttributeChooserForm()AttributeChooserForm(java.util.Set<Attribute> availableAttributes, java.util.Set<Attribute> chosenAttributes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.util.Set<Attribute>getAvailableAttributes()java.util.Set<Attribute>getChosenAttributes()java.util.Set<Attribute>getSelectedAttributes()Returns list of selected attributes.inthashCode()booleanhasPopulatedAttributes()Tells if form has populated datagetChosenAttributes()orgetAvailableAttributes()is not empty.booleanhasSelectedAttributes()TellsgetSelectedAttributes()is not empty.booleanisIncludeAll()Tells if form should return all attributes both from available and chosen as selected ones.protected java.util.Set<Attribute>mergeAttributes(java.util.Set<Attribute> available, java.util.Set<Attribute> choosen)voidsetAvailableAttributes(java.util.Set<Attribute> availableAttributes)Sets list of available attributes.voidsetChosenAttributes(java.util.Set<Attribute> chosenAttributes)Sets list of chosen attributes.voidsetIncludeAll(boolean includeAll)Defines if form should return all attributes both from available and chosen as selected ones.
-
-
-
Method Detail
-
hasPopulatedAttributes
public boolean hasPopulatedAttributes()
Tells if form has populated datagetChosenAttributes()orgetAvailableAttributes()is not empty.- Returns:
- true if data has been populated.
-
hasSelectedAttributes
public boolean hasSelectedAttributes()
TellsgetSelectedAttributes()is not empty.- Returns:
- true if attributes are selected.
-
getSelectedAttributes
public java.util.Set<Attribute> getSelectedAttributes()
Returns list of selected attributes. IfisIncludeAll()is true the it return merged list ofgetChosenAttributes()andgetAvailableAttributes(). If include all is not selected it returns justgetChosenAttributes()- Returns:
- list of selected attributes
-
mergeAttributes
protected java.util.Set<Attribute> mergeAttributes(java.util.Set<Attribute> available, java.util.Set<Attribute> choosen)
-
getAvailableAttributes
public java.util.Set<Attribute> getAvailableAttributes()
- Returns:
- list of available to choose attributes.
-
setAvailableAttributes
public void setAvailableAttributes(java.util.Set<Attribute> availableAttributes)
Sets list of available attributes.- Parameters:
availableAttributes- list of chosen attributes.
-
getChosenAttributes
public java.util.Set<Attribute> getChosenAttributes()
- Returns:
- list of chosen attributes.
-
setChosenAttributes
public void setChosenAttributes(java.util.Set<Attribute> chosenAttributes)
Sets list of chosen attributes.- Parameters:
chosenAttributes- list of chosen attributes.
-
isIncludeAll
public boolean isIncludeAll()
Tells if form should return all attributes both from available and chosen as selected ones.- Returns:
- true if all should be included in
getSelectedAttributes().
-
setIncludeAll
public void setIncludeAll(boolean includeAll)
Defines if form should return all attributes both from available and chosen as selected ones.
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-