java.lang.Object
java.lang.Record
com.darkcollective.relix.symbol.graph.Endpoint
Record Components:
relation - the relation at this endpoint; never null
columns - the ordered join columns; never empty
min - lower multiplicity bound; never negative (default 0)
max - upper multiplicity bound; empty = unbounded (default)

public record Endpoint(RelationSymbol relation, List<String> columns, long min, OptionalLong max) extends Record
One side of a Relationship: a relation plus the ordered columns joined at this side, carrying numeric multiplicity bounds.

The relation may be any RelationSymbol kind — including a QueryRelationSymbol, so a relationship can target a derived view ("active orders") exactly as it targets a base table.

Column lists are positional: the i-th column of one endpoint equijoins the i-th column of the other. A composite foreign key is one edge with multi-column endpoints, never two single-column edges.

The bounds state how many rows of this endpoint's relation may match one row of the opposite endpoint. The defaults — min = 0, max absent (∞) — are the unconstrained reading: an omitted bound asserts nothing, so the engine never over-commits. min = 0 is the outer-join signal (an inner join may drop opposite-side rows); a finite max is a fan-out and selectivity fact.

  • Constructor Details

    • Endpoint

      public Endpoint(RelationSymbol relation, List<String> columns, long min, OptionalLong max)
      Creates an instance of a Endpoint record class.
      Parameters:
      relation - the value for the relation record component
      columns - the value for the columns record component
      min - the value for the min record component
      max - the value for the max record component
  • Method Details

    • unbounded

      public static Endpoint unbounded(RelationSymbol relation, List<String> columns)
      Creates an endpoint with the default unconstrained bounds [0..*].
    • bounded

      public boolean bounded()
      Returns true if any bound was actually constrained beyond the 0/∞ defaults.
    • boundsLabel

      public String boundsLabel()
      The display form of this endpoint's bounds, e.g. [1..50] or [0..*].
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • relation

      public RelationSymbol relation()
      Returns the value of the relation record component.
      Returns:
      the value of the relation record component
    • columns

      public List<String> columns()
      Returns the value of the columns record component.
      Returns:
      the value of the columns record component
    • min

      public long min()
      Returns the value of the min record component.
      Returns:
      the value of the min record component
    • max

      public OptionalLong max()
      Returns the value of the max record component.
      Returns:
      the value of the max record component