Interface LogicalConditional<C extends LogicalConditional<C>>
- All Superinterfaces:
Conditional<C>
,Copyable<C>
- All Known Implementing Classes:
DefaultLogicalConditional
An extension of
Conditional
that is used for performing logical operations on a set of
conditionals.
For example, a conditional that is a match when only one of two conditionals must match:
Conditionals.or( Conditionals.when("type").equalTo("PRODUCT"), Conditionals.when("type").equalTo("VARIANT"))
- Author:
- Nick Crum (ncrum)
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault C
and()
Define the operator asLogicalConditional.LogicalOperators.AND
.default C
Clears the current conditions on this conditional.default C
conditional
(Conditional<?>... conditionals) Adds one or more conditions to this conditional.default C
conditionals
(List<Conditional<?>> conditionals) Adds one or more conditions to this conditional.List<Conditional<?>>
default String
getType()
The type of conditional.default C
not()
Define the operator asLogicalConditional.LogicalOperators.NOT
.default C
Define the operator for this conditional.default C
or()
Define the operator asLogicalConditional.LogicalOperators.OR
.void
setConditionals
(List<Conditional<?>> conditionals) void
setOperator
(String operator) Methods inherited from interface com.broadleafcommerce.metadata.dsl.core.Conditional
self
-
Field Details
-
TYPE
- See Also:
-
-
Method Details
-
getType
Description copied from interface:Conditional
The type of conditional. This is used to distinguish different types of conditionals.- Specified by:
getType
in interfaceConditional<C extends LogicalConditional<C>>
- Returns:
- the type
-
getOperator
String getOperator() -
getConditionals
List<Conditional<?>> getConditionals() -
setOperator
-
setConditionals
-
operator
Define the operator for this conditional.- Parameters:
operator
- the operator- Returns:
- this
-
and
Define the operator asLogicalConditional.LogicalOperators.AND
.- Returns:
- this
-
or
Define the operator asLogicalConditional.LogicalOperators.OR
.- Returns:
- this
-
not
Define the operator asLogicalConditional.LogicalOperators.NOT
.- Returns:
- this
-
conditional
Adds one or more conditions to this conditional.- Parameters:
conditionals
- the conditional(s)- Returns:
- this
-
conditionals
Adds one or more conditions to this conditional.- Parameters:
conditionals
- the conditional(s)- Returns:
- this
-
clearConditionals
Clears the current conditions on this conditional.- Returns:
- this
-