Interface PropertyConditional<C extends PropertyConditional<C>>
- All Superinterfaces:
Conditional<C>
,Copyable<C>
- All Known Implementing Classes:
DefaultPropertyConditional
An extension of
Conditional
that is used for checking if a property matches a certain
criteria or value. This conditional is useful in scenarios where a property's state is relevant
to gate certain functionality.
For example, a conditional that is match when the property "type" has a value of "PRODUCT":
Conditionals.when("type").equalTo("PRODUCT")
- Author:
- Nick Crum (ncrum)
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
The default set of common supported operators. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault C
blank()
Condition is true when thefield(java.lang.String)
value is blank.default C
Condition is true when thefield(java.lang.String)
contains thevalue(java.lang.Object)
.default C
containsIgnoreCase
(Object value) Condition is true when thefield(java.lang.String)
contains thevalue(java.lang.Object)
ignoring case.default C
empty()
Condition is true when thefield(java.lang.String)
value is empty.default C
Condition is true when thefield(java.lang.String)
is equal tovalue(java.lang.Object)
.default C
exists()
Condition is true when thefield(java.lang.String)
exists.default C
Define the field targeted by this conditional.getField()
default String
getType()
The type of conditional.getValue()
default C
greaterThan
(Object value) Condition is true when thefield(java.lang.String)
is greater thanvalue(java.lang.Object)
.default C
greaterThanOrEqualTo
(Object value) Condition is true when thefield(java.lang.String)
is greater than or equal tovalue(java.lang.Object)
.default C
Condition is true when thefield(java.lang.String)
is less thanvalue(java.lang.Object)
.default C
lessThanOrEqualTo
(Object value) Condition is true when thefield(java.lang.String)
is less than or equal tovalue(java.lang.Object)
.default C
none()
Alias fornotExists()
.default C
notBlank()
Condition is true when thefield(java.lang.String)
value is not blank.default C
notContains
(Object value) Condition is true when thefield(java.lang.String)
does not contain thevalue(java.lang.Object)
.default C
notContainsIgnoreCase
(Object value) Condition is true when thefield(java.lang.String)
does not contain thevalue(java.lang.Object)
ignoring case.default C
notEmpty()
Condition is true when thefield(java.lang.String)
value is not empty.default C
notEqualTo
(Object value) Condition is true when thefield(java.lang.String)
is not equal tovalue(java.lang.Object)
.default C
Condition is true when thefield(java.lang.String)
does not exist.default C
Define the operator for this conditional.void
void
setOperator
(String operator) void
default C
Define the value for this conditional.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 PropertyConditional<C>>
- Returns:
- the type
-
getField
String getField() -
getOperator
String getOperator() -
getValue
-
setField
-
setOperator
-
setValue
-
field
Define the field targeted by this conditional.- Parameters:
field
- the field name- Returns:
- this
-
operator
Define the operator for this conditional. Typically one ofPropertyConditional.DefaultOperators
.- Parameters:
operator
- the operator- Returns:
- this
-
value
Define the value for this conditional.- Parameters:
value
- the value- Returns:
- this
-
exists
Condition is true when thefield(java.lang.String)
exists.- Returns:
- the conditional
-
empty
Condition is true when thefield(java.lang.String)
value is empty.- Returns:
- the conditional
- Since:
- Metadata 2.0.6
-
notEmpty
Condition is true when thefield(java.lang.String)
value is not empty.- Returns:
- the conditional
- Since:
- Metadata 2.0.6
-
blank
Condition is true when thefield(java.lang.String)
value is blank.- Returns:
- the conditional
- Since:
- Metadata 2.0.6
-
notBlank
Condition is true when thefield(java.lang.String)
value is not blank.- Returns:
- the conditional
-
notExists
Condition is true when thefield(java.lang.String)
does not exist.- Returns:
- the conditional
-
none
Alias fornotExists()
.- Returns:
- the conditional
-
equalTo
Condition is true when thefield(java.lang.String)
is equal tovalue(java.lang.Object)
.- Returns:
- the conditional
-
notEqualTo
Condition is true when thefield(java.lang.String)
is not equal tovalue(java.lang.Object)
.- Returns:
- the conditional
-
greaterThan
Condition is true when thefield(java.lang.String)
is greater thanvalue(java.lang.Object)
.- Returns:
- the conditional
-
greaterThanOrEqualTo
Condition is true when thefield(java.lang.String)
is greater than or equal tovalue(java.lang.Object)
.- Returns:
- the conditional
-
lessThan
Condition is true when thefield(java.lang.String)
is less thanvalue(java.lang.Object)
.- Returns:
- the conditional
-
lessThanOrEqualTo
Condition is true when thefield(java.lang.String)
is less than or equal tovalue(java.lang.Object)
.- Returns:
- the conditional
-
contains
Condition is true when thefield(java.lang.String)
contains thevalue(java.lang.Object)
.- Returns:
- the conditional
-
containsIgnoreCase
Condition is true when thefield(java.lang.String)
contains thevalue(java.lang.Object)
ignoring case.- Returns:
- the conditional
-
notContains
Condition is true when thefield(java.lang.String)
does not contain thevalue(java.lang.Object)
.- Returns:
- the conditional
-
notContainsIgnoreCase
Condition is true when thefield(java.lang.String)
does not contain thevalue(java.lang.Object)
ignoring case.- Returns:
- the conditional
-