Class DefaultCollectionConditional
- java.lang.Object
-
- com.broadleafcommerce.metadata.dsl.core.extension.conditionals.DefaultCollectionConditional
-
- All Implemented Interfaces:
Conditional<DefaultCollectionConditional>,Copyable<DefaultCollectionConditional>,CollectionConditional<DefaultCollectionConditional>,Serializable
public class DefaultCollectionConditional extends Object implements Serializable, CollectionConditional<DefaultCollectionConditional>
The default implementation ofCollectionConditional.- Author:
- Nick Crum (ncrum)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.broadleafcommerce.metadata.dsl.core.extension.conditionals.CollectionConditional
CollectionConditional.CollectionConditionalMatchStrategy
-
-
Field Summary
-
Fields inherited from interface com.broadleafcommerce.metadata.dsl.core.extension.conditionals.CollectionConditional
TYPE
-
-
Constructor Summary
Constructors Constructor Description DefaultCollectionConditional(CollectionConditional<?> conditional)DefaultCollectionConditional(String field)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleancanEqual(Object other)DefaultCollectionConditionalcopy()booleanequals(Object o)List<Conditional<?>>getConditionals()Conditionals that will be matched against the collection members.StringgetField()Field name target for this conditional.StringgetMatchStrategy()The match strategy for this conditional.inthashCode()booleanisMatchIfEmpty()Whether or not empty is considered a valid match.voidsetConditionals(List<Conditional<?>> conditionals)Conditionals that will be matched against the collection members.voidsetField(String field)Field name target for this conditional.voidsetMatchIfEmpty(boolean matchIfEmpty)Whether or not empty is considered a valid match.voidsetMatchStrategy(String matchStrategy)The match strategy for this conditional.-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.broadleafcommerce.metadata.dsl.core.extension.conditionals.CollectionConditional
allMatch, anyMatch, clearConditionals, conditional, conditionals, field, getType, matchIfEmpty, matchStrategy, notMatchIfEmpty
-
Methods inherited from interface com.broadleafcommerce.metadata.dsl.core.Conditional
self
-
-
-
-
Constructor Detail
-
DefaultCollectionConditional
public DefaultCollectionConditional(String field)
-
DefaultCollectionConditional
public DefaultCollectionConditional(CollectionConditional<?> conditional)
-
-
Method Detail
-
copy
public DefaultCollectionConditional copy()
- Specified by:
copyin interfaceCopyable<DefaultCollectionConditional>- Returns:
- a deep copy of this instance
-
getField
public String getField()
Field name target for this conditional.- Specified by:
getFieldin interfaceCollectionConditional<DefaultCollectionConditional>
-
getMatchStrategy
public String getMatchStrategy()
The match strategy for this conditional. IfCollectionConditional.CollectionConditionalMatchStrategy.ALL, this will match only when all collection members are a match. IfCollectionConditional.CollectionConditionalMatchStrategy.ANY, this will match when at least one collection member is a match.- Specified by:
getMatchStrategyin interfaceCollectionConditional<DefaultCollectionConditional>
-
getConditionals
public List<Conditional<?>> getConditionals()
Conditionals that will be matched against the collection members.- Specified by:
getConditionalsin interfaceCollectionConditional<DefaultCollectionConditional>
-
isMatchIfEmpty
public boolean isMatchIfEmpty()
Whether or not empty is considered a valid match.- Specified by:
isMatchIfEmptyin interfaceCollectionConditional<DefaultCollectionConditional>
-
setField
public void setField(String field)
Field name target for this conditional.- Specified by:
setFieldin interfaceCollectionConditional<DefaultCollectionConditional>
-
setMatchStrategy
public void setMatchStrategy(String matchStrategy)
The match strategy for this conditional. IfCollectionConditional.CollectionConditionalMatchStrategy.ALL, this will match only when all collection members are a match. IfCollectionConditional.CollectionConditionalMatchStrategy.ANY, this will match when at least one collection member is a match.- Specified by:
setMatchStrategyin interfaceCollectionConditional<DefaultCollectionConditional>
-
setConditionals
public void setConditionals(List<Conditional<?>> conditionals)
Conditionals that will be matched against the collection members.- Specified by:
setConditionalsin interfaceCollectionConditional<DefaultCollectionConditional>
-
setMatchIfEmpty
public void setMatchIfEmpty(boolean matchIfEmpty)
Whether or not empty is considered a valid match.- Specified by:
setMatchIfEmptyin interfaceCollectionConditional<DefaultCollectionConditional>
-
canEqual
protected boolean canEqual(Object other)
-
-