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 enumThe default set of common supported operators. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault CCondition is true when thefield(java.lang.String)contains thevalue(java.lang.Object).default CcontainsIgnoreCase(Object value) Condition is true when thefield(java.lang.String)contains thevalue(java.lang.Object)ignoring case.default CCondition is true when thefield(java.lang.String)is equal tovalue(java.lang.Object).default Cexists()Condition is true when thefield(java.lang.String)exists.default CDefine the field targeted by this conditional.getField()default StringgetType()The type of conditional.getValue()default CgreaterThan(Object value) Condition is true when thefield(java.lang.String)is greater thanvalue(java.lang.Object).default CgreaterThanOrEqualTo(Object value) Condition is true when thefield(java.lang.String)is greater than or equal tovalue(java.lang.Object).default CCondition is true when thefield(java.lang.String)is less thanvalue(java.lang.Object).default ClessThanOrEqualTo(Object value) Condition is true when thefield(java.lang.String)is less than or equal tovalue(java.lang.Object).default Cnone()Alias fornotExists().default CnotBlank()Condition is true when thefield(java.lang.String)value is not blank.default CnotContains(Object value) Condition is true when thefield(java.lang.String)does not contain thevalue(java.lang.Object).default CnotContainsIgnoreCase(Object value) Condition is true when thefield(java.lang.String)does not contain thevalue(java.lang.Object)ignoring case.default CnotEqualTo(Object value) Condition is true when thefield(java.lang.String)is not equal tovalue(java.lang.Object).default CCondition is true when thefield(java.lang.String)does not exist.default CDefine the operator for this conditional.voidvoidsetOperator(String operator) voiddefault CDefine 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:ConditionalThe type of conditional. This is used to distinguish different types of conditionals.- Specified by:
getTypein 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
-
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
-