Record Class EndpointSpec
java.lang.Object
java.lang.Record
com.darkcollective.relix.lang.ast.EndpointSpec
- Record Components:
relationRef- the referenced relation name (possibly namespace-qualified); must not be blankcolumns- the ordered column names at this endpoint; must not be emptymin- the lower multiplicity bound; must not be negative (default 0)max- the upper multiplicity bound; empty = unbounded (∞)location- the source location of the endpoint's first token
public record EndpointSpec(String relationRef, List<String> columns, long min, OptionalLong max, SourceLocation location)
extends Record
One endpoint of a
RelateStatement — a relation reference plus the
ordered columns joined at this side, with optional multiplicity bounds.
Syntactic forms:
Orders.order_id // single-column shorthand Orders(order_id) [1..50] // parenthesised, with bounds WarehouseSlot(tenant_id, product_id) // composite key — ONE endpoint
The relation reference is purely syntactic at this level; it is resolved
against the symbol table during semantic analysis. Omitted bounds default to
the unconstrained reading [0..*]: an absent max (empty
OptionalLong) means unbounded.
Bound consistency (max ≥ min, max ≥ 1) is
deliberately not enforced here — the semantic layer reports violations as
positioned diagnostics rather than construction failures.
-
Constructor Summary
ConstructorsConstructorDescriptionEndpointSpec(String relationRef, List<String> columns, long min, OptionalLong max, SourceLocation location) Creates an instance of aEndpointSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolumns()Returns the value of thecolumnsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.location()Returns the value of thelocationrecord component.max()Returns the value of themaxrecord component.longmin()Returns the value of theminrecord component.Returns the value of therelationRefrecord component.final StringtoString()Returns a string representation of this record class.static EndpointSpecunbounded(String relationRef, List<String> columns, SourceLocation location) Creates an endpoint with the default unconstrained bounds[0..*].
-
Constructor Details
-
EndpointSpec
public EndpointSpec(String relationRef, List<String> columns, long min, OptionalLong max, SourceLocation location) Creates an instance of aEndpointSpecrecord class.- Parameters:
relationRef- the value for therelationRefrecord componentcolumns- the value for thecolumnsrecord componentmin- the value for theminrecord componentmax- the value for themaxrecord componentlocation- the value for thelocationrecord component
-
-
Method Details
-
unbounded
public static EndpointSpec unbounded(String relationRef, List<String> columns, SourceLocation location) Creates an endpoint with the default unconstrained bounds[0..*]. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
relationRef
Returns the value of therelationRefrecord component.- Returns:
- the value of the
relationRefrecord component
-
columns
Returns the value of thecolumnsrecord component.- Returns:
- the value of the
columnsrecord component
-
min
public long min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-
location
Returns the value of thelocationrecord component.- Returns:
- the value of the
locationrecord component
-