public class BooleanCondition extends DefaultCondition<java.lang.Boolean>
It contains a DslField to get the value from the model, a LeafMetadata to describe this node, and a
BiFunction to take the value from the model and return an optional value.
| Modifier and Type | Field and Description |
|---|---|
protected DslField |
field |
protected java.util.function.BiFunction<DslModel,Context,java.util.Optional<N>> |
function |
protected PredicateMetadata |
metadata |
protected java.util.function.BiFunction<DslModel,DslField,java.util.Optional<N>> |
value |
| Constructor and Description |
|---|
BooleanCondition(DslField field) |
BooleanCondition(DslField field,
LeafMetadata metadata,
java.util.function.BiFunction<DslModel,Context,java.util.Optional<java.lang.Boolean>> value) |
| Modifier and Type | Method and Description |
|---|---|
StepCondition |
and(boolean value)
Returns a step condition checking if the node value and the given value is true.
|
StepCondition |
and(LogicalFieldInfo value)
Returns a step condition checking if the node value and the given field value is true.
|
PredicateMetadata |
getMetadata() |
StepCondition |
isFalse()
Returns a step condition checking if the node value is false.
|
StepCondition |
isTrue()
Returns a step condition checking if the node value is true.
|
StepCondition |
not()
Returns a step condition checking if the node value is not true.
|
StepCondition |
or(boolean value)
Returns a step condition checking if the node value or the given value is true.
|
StepCondition |
or(LogicalFieldInfo value)
Returns a step condition checking if the node value or the given field value is true.
|
protected StepCondition |
predicate(LeafMetadata metadata,
java.util.function.BiFunction<DslModel,Context,java.util.Optional<N>> value,
java.util.function.BiFunction<N,N,java.lang.Boolean> predicate) |
protected StepCondition |
predicate(LeafMetadata metadata,
java.util.function.Function<N,java.lang.Boolean> predicate) |
java.lang.String |
readable()
Returns the human readable version of this object.
|
protected java.util.Optional<N> |
value(DslModel model,
DslField field) |
protected java.util.Optional<N> |
valueModel(DslModel model,
DslField field) |
StepCondition |
xor(boolean value)
Returns a step condition checking if the node value or exclusive the given value is true.
|
StepCondition |
xor(LogicalFieldInfo value)
Returns a step condition checking if the node value or exclusive the given field value is true.
|
protected final DslField field
protected final PredicateMetadata metadata
public BooleanCondition(DslField field)
public BooleanCondition(DslField field, LeafMetadata metadata, java.util.function.BiFunction<DslModel,Context,java.util.Optional<java.lang.Boolean>> value)
public final StepCondition not()
public final StepCondition and(boolean value)
value - the right valuepublic final StepCondition and(LogicalFieldInfo value)
value - the right field valuepublic final StepCondition or(boolean value)
value - the right valuepublic final StepCondition or(LogicalFieldInfo value)
value - the right valuepublic final StepCondition xor(boolean value)
value - the right valuepublic final StepCondition xor(LogicalFieldInfo value)
value - the right field valuepublic final StepCondition isTrue()
public final StepCondition isFalse()
protected final StepCondition predicate(LeafMetadata metadata, java.util.function.Function<N,java.lang.Boolean> predicate)
protected final StepCondition predicate(LeafMetadata metadata, java.util.function.BiFunction<DslModel,Context,java.util.Optional<N>> value, java.util.function.BiFunction<N,N,java.lang.Boolean> predicate)
public PredicateMetadata getMetadata()