Record Class PushdownTarget
java.lang.Object
java.lang.Record
com.darkcollective.relix.function.PushdownTarget
- Record Components:
family- the backend family, lower-cased and never blankvariant- the dialect within that family, lower-cased; empty when the family has only one
The backend a call is being rendered for, named in a way the SPI can carry without
knowing anything about query planning.
A target is a family plus a variant: ("sql", "postgres"),
("sql", "mysql"), ("mongo", ""). The family says what shape of text
is wanted — SQL expression syntax, a MongoDB aggregation expression — and the variant
distinguishes dialects within it. A spelling that is the same everywhere in a family
can ignore the variant; one that is not switches on it.
Both parts are matched lower-cased, and an absent variant is the empty string
rather than null.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPushdownTarget(String family, String variant) Creates an instance of aPushdownTargetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.family()Returns the value of thefamilyrecord component.final inthashCode()Returns a hash code value for this object.booleanbooleanstatic PushdownTargetmongo()The MongoDB aggregation-expression target.static PushdownTargetA SQL target for the named dialect.final StringtoString()Returns a string representation of this record class.variant()Returns the value of thevariantrecord component.
-
Field Details
-
SQL
The family of backends that speak SQL expression syntax.- See Also:
-
MONGO
The family of backends that speak MongoDB aggregation expressions.- See Also:
-
-
Constructor Details
-
Method Details
-
sql
A SQL target for the named dialect.- Parameters:
dialect- the dialect name, e.g."postgres"; may be empty for dialect-neutral SQL- Returns:
- the target
-
mongo
The MongoDB aggregation-expression target.- Returns:
- the target
-
isFamily
- Parameters:
candidate- a family name, in any case- Returns:
truewhen this target belongs to that family
-
isVariant
- Parameters:
candidate- a variant name, in any case- Returns:
truewhen this target's variant iscandidate
-
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). -
family
Returns the value of thefamilyrecord component.- Returns:
- the value of the
familyrecord component
-
variant
Returns the value of thevariantrecord component.- Returns:
- the value of the
variantrecord component
-