Class AttributeModifierCriteria
java.lang.Object
de.hybris.platform.servicelayer.type.AttributeModifierCriteria
- Direct Known Subclasses:
ImmutableAttributeModifierCriteria
Class that contains combined criteria for searching and filtering attribute descriptors. Criteria are defined as
three sections:
- exclusive - they should be matched exactly
- alternative - all set modifiers should be matched
- disallowed - none of set modifiers should be matched
AttributeModifiers
to build the criteria.-
Constructor Summary
ConstructorsConstructorDescriptionAttributeModifierCriteria(int exclusive, int alternative, int disallowed) Instantiates a new attribute modifier criteria with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAlternative(int modifier) Adds the alternative attribute modifier for filtering.voidaddDisallowed(int modifier) Adds the disallowed attribute modifier for filtering.voidaddRequired(int modifier) Adds the required attribute modifier for filtering.booleanmatches(int actualAttributeModifiers) Function checks if the given combined attribute modifier matches current state of this criteria.
-
Constructor Details
-
AttributeModifierCriteria
public AttributeModifierCriteria(int exclusive, int alternative, int disallowed) Instantiates a new attribute modifier criteria with the given parameters.- Parameters:
exclusive- the exclusivealternative- the alternativedisallowed- the disallowed
-
-
Method Details
-
addRequired
public void addRequired(int modifier) Adds the required attribute modifier for filtering. Selected attribute modifier is mandatory in the search result.- Parameters:
modifier- the modifier
-
addAlternative
public void addAlternative(int modifier) Adds the alternative attribute modifier for filtering. At least one of the alternative modifiers is mandatory in the search result.- Parameters:
modifier- the modifier
-
addDisallowed
public void addDisallowed(int modifier) Adds the disallowed attribute modifier for filtering. None of the disallowed modifiers must be present in the attribute descriptor that is in the search result.- Parameters:
modifier- the modifier
-
matches
public boolean matches(int actualAttributeModifiers) Function checks if the given combined attribute modifier matches current state of this criteria.- Parameters:
actualAttributeModifiers- the actual attribute modifiers- Returns:
- true, if successful
-