Record Class GqlNode

java.lang.Object
java.lang.Record
dev.grafeo.gwp.types.GqlNode
Record Components:
id - the opaque element identifier
labels - the label set (unordered)
properties - the property map

public record GqlNode(byte[] id, List<String> labels, Map<String,Object> properties) extends Record
A property graph node.
  • Constructor Details

    • GqlNode

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

    • hasLabel

      public boolean hasLabel(String label)
      Check if this node has the given label.
      Parameters:
      label - the label to check
      Returns:
      true if the node 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. All components in this record class are compared with Objects::equals(Object,Object).
      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
    • properties

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