java.lang.Object
java.lang.Record
org.litebridge.db.spi.query.ConditionGroup
- Record Components:
conditions- A list of conditions to be combined.subgroups- A list of subgroups of conditions to be combined.
public record ConditionGroup(List<LogicCondition> conditions, List<LogicConditionGroup> subgroups)
extends Record
A group of logically combined conditions and condition subgroups.
-
Constructor Summary
ConstructorsConstructorDescriptionConditionGroup(List<LogicCondition> conditions) Constructs aConditionGroupwith the specified conditions.ConditionGroup(List<LogicCondition> conditions, List<LogicConditionGroup> subgroups) Creates an instance of aConditionGrouprecord class.ConditionGroup(LogicCondition condition) Constructs aConditionGroupwith a single condition. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconditionsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisEmpty()Checks if the condition group is empty.Returns the value of thesubgroupsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConditionGroup
Constructs aConditionGroupwith the specified conditions.- Parameters:
conditions- the list of conditions
-
ConditionGroup
Constructs aConditionGroupwith a single condition.- Parameters:
condition- the condition to add
-
ConditionGroup
Creates an instance of aConditionGrouprecord class.- Parameters:
conditions- the value for theconditionsrecord componentsubgroups- the value for thesubgroupsrecord component
-
-
Method Details
-
isEmpty
public boolean isEmpty()Checks if the condition group is empty.- Returns:
trueif the group contains no conditions or subgroups;falseotherwise
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
conditions
Returns the value of theconditionsrecord component.- Returns:
- the value of the
conditionsrecord component
-
subgroups
Returns the value of thesubgroupsrecord component.- Returns:
- the value of the
subgroupsrecord component
-