Record Class GqlEdge

java.lang.Object
java.lang.Record
dev.grafeo.gwp.types.GqlEdge
Record Components:
id - the opaque element identifier
labels - the label set
sourceNodeId - the source node ID (directed) or endpoint A
targetNodeId - the target node ID (directed) or endpoint B
undirected - true if this is an undirected edge
properties - the property map

public record GqlEdge(byte[] id, List<String> labels, byte[] sourceNodeId, byte[] targetNodeId, boolean undirected, Map<String,Object> properties) extends Record
A property graph edge (directed or undirected).
  • Constructor Details

    • GqlEdge

      public GqlEdge(byte[] id, List<String> labels, byte[] sourceNodeId, byte[] targetNodeId, boolean undirected, Map<String,Object> properties)
      Creates an instance of a GqlEdge record class.
      Parameters:
      id - the value for the id record component
      labels - the value for the labels record component
      sourceNodeId - the value for the sourceNodeId record component
      targetNodeId - the value for the targetNodeId record component
      undirected - the value for the undirected record component
      properties - the value for the properties record component
  • Method Details

    • hasLabel

      public boolean hasLabel(String label)
      Check if this edge has the given label.
      Parameters:
      label - the label to check
      Returns:
      true if the edge has the label
    • property

      public Object property(String key)
      Get a property value by key.
      Parameters:
      key - the property key
      Returns:
      the property value, or null if not found
    • 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.
    • id

      public byte[] id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • labels

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

      public byte[] sourceNodeId()
      Returns the value of the sourceNodeId record component.
      Returns:
      the value of the sourceNodeId record component
    • targetNodeId

      public byte[] targetNodeId()
      Returns the value of the targetNodeId record component.
      Returns:
      the value of the targetNodeId record component
    • undirected

      public boolean undirected()
      Returns the value of the undirected record component.
      Returns:
      the value of the undirected record component
    • properties

      public Map<String,Object> properties()
      Returns the value of the properties record component.
      Returns:
      the value of the properties record component