java.lang.Object
redis.clients.jedis.graph.entities.GraphEntity
redis.clients.jedis.graph.entities.Node

public class Node extends GraphEntity
* A class represent an node (graph entity). In addition to the base class id and properties, a node has labels.
  • Field Details

  • Constructor Details

    • Node

      public Node()
    • Node

      public Node(int labelsCapacity, int propertiesCapacity)
      Use this constructor to reduce memory allocations when labels or properties are added to the node
      Parameters:
      labelsCapacity - preallocate the capacity for the node labels
      propertiesCapacity - preallocate the capacity for the properties
  • Method Details

    • addLabel

      public void addLabel(String label)
      Parameters:
      label - - a label to be add
    • removeLabel

      public void removeLabel(String label)
      Parameters:
      label - - a label to be removed
    • getLabel

      public String getLabel(int index)
      Parameters:
      index - - label index
      Returns:
      the property label
      Throws:
      IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= getNumberOfLabels())
    • getNumberOfLabels

      public int getNumberOfLabels()
      Returns:
      the number of labels
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class GraphEntity
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class GraphEntity
    • toString

      public String toString()
      Specified by:
      toString in class GraphEntity