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 boolean
canEqual(Object other)
DefaultCollectionConditional
copy()
boolean
equals(Object o)
List<Conditional<?>>
getConditionals()
Conditionals that will be matched against the collection members.String
getField()
Field name target for this conditional.String
getMatchStrategy()
The match strategy for this conditional.int
hashCode()
boolean
isMatchIfEmpty()
Whether or not empty is considered a valid match.void
setConditionals(List<Conditional<?>> conditionals)
Conditionals that will be matched against the collection members.void
setField(String field)
Field name target for this conditional.void
setMatchIfEmpty(boolean matchIfEmpty)
Whether or not empty is considered a valid match.void
setMatchStrategy(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:
copy
in interfaceCopyable<DefaultCollectionConditional>
- Returns:
- a deep copy of this instance
-
getField
public String getField()
Field name target for this conditional.- Specified by:
getField
in 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:
getMatchStrategy
in interfaceCollectionConditional<DefaultCollectionConditional>
-
getConditionals
public List<Conditional<?>> getConditionals()
Conditionals that will be matched against the collection members.- Specified by:
getConditionals
in interfaceCollectionConditional<DefaultCollectionConditional>
-
isMatchIfEmpty
public boolean isMatchIfEmpty()
Whether or not empty is considered a valid match.- Specified by:
isMatchIfEmpty
in interfaceCollectionConditional<DefaultCollectionConditional>
-
setField
public void setField(String field)
Field name target for this conditional.- Specified by:
setField
in 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:
setMatchStrategy
in interfaceCollectionConditional<DefaultCollectionConditional>
-
setConditionals
public void setConditionals(List<Conditional<?>> conditionals)
Conditionals that will be matched against the collection members.- Specified by:
setConditionals
in interfaceCollectionConditional<DefaultCollectionConditional>
-
setMatchIfEmpty
public void setMatchIfEmpty(boolean matchIfEmpty)
Whether or not empty is considered a valid match.- Specified by:
setMatchIfEmpty
in interfaceCollectionConditional<DefaultCollectionConditional>
-
canEqual
protected boolean canEqual(Object other)
-
-