java.lang.Object
java.lang.Record
org.litebridge.orm.api.select.model.ConditionGroupSpec
- Record Components:
conditions- A list of conditions to be combined.subgroups- A list of subgroups of conditions to be combined.
public record ConditionGroupSpec(List<LogicConditionSpec> conditions, List<LogicConditionGroupSpec> subgroups)
extends Record
Groups conditions and condition subgroups using a logical operator.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs an emptyConditionGroupSpec.ConditionGroupSpec(List<LogicConditionSpec> conditions) Constructs aConditionGroupSpecwith the specified conditions.ConditionGroupSpec(List<LogicConditionSpec> conditions, List<LogicConditionGroupSpec> subgroups) Constructs aConditionGroupSpecwith the specified conditions and subgroups. -
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.newCondition(LogicOperator logicOperator, ExpressionSpec expressionSpec) Adds a new condition to the group and returns its specification.newSubgroup(LogicOperator logicOperator) Adds a new subgroup to the group and returns its specification.Returns the value of thesubgroupsrecord component.toConditionGroup(SelectExpressionMapper selectExpressionMapper, Set<Table> selectedTables) Converts this specification into aConditionGroup.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConditionGroupSpec
public ConditionGroupSpec(List<LogicConditionSpec> conditions, List<LogicConditionGroupSpec> subgroups) Constructs aConditionGroupSpecwith the specified conditions and subgroups.- Parameters:
conditions- the list of logic condition specificationssubgroups- the list of logic condition group specifications
-
ConditionGroupSpec
Constructs aConditionGroupSpecwith the specified conditions.- Parameters:
conditions- the list of logic condition specifications
-
ConditionGroupSpec
public ConditionGroupSpec()Constructs an emptyConditionGroupSpec.
-
-
Method Details
-
newCondition
Adds a new condition to the group and returns its specification.- Parameters:
logicOperator- the logic operator for the conditionexpressionSpec- the expression specification for the condition- Returns:
- the newly created
ConditionSpec
-
newSubgroup
Adds a new subgroup to the group and returns its specification.- Parameters:
logicOperator- the logic operator for the subgroup- Returns:
- the newly created
LogicConditionGroupSpec
-
toConditionGroup
public ConditionGroup toConditionGroup(SelectExpressionMapper selectExpressionMapper, Set<Table> selectedTables) Converts this specification into aConditionGroup.- Parameters:
selectExpressionMapper- the mapper to use for expressionsselectedTables- the set of tables included in the query- Returns:
- the resulting
ConditionGroup
-
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
-