Record Class ConfiguredNode

java.lang.Object
java.lang.Record
com.yahoo.vdslib.distribution.ConfiguredNode
All Implemented Interfaces:
Comparable<ConfiguredNode>

public record ConfiguredNode(int index, boolean retired) extends Record implements Comparable<ConfiguredNode>
A node configured to exist, with its configured node specific information. This is immutable. The identity and natural order of a node is its index.
Author:
bratseth
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConfiguredNode(int index, boolean retired)
    Creates an instance of a ConfiguredNode record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    boolean
    equals(Object other)
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    int
    Return the index (distribution key) of this node
    boolean
    Returns whether the node is configured to be retired
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ConfiguredNode

      public ConfiguredNode(int index, boolean retired)
      Creates an instance of a ConfiguredNode record class.
      Parameters:
      index - the value for the index record component
      retired - the value for the retired record component
  • Method Details

    • index

      public int index()
      Return the index (distribution key) of this node
    • retired

      public boolean retired()
      Returns whether the node is configured to be retired
    • hashCode

      public 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 boolean equals(Object other)
      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 '=='.
      Specified by:
      equals in class Record
      Parameters:
      other - the object with which to compare
      Returns:
      true if this object is the same as the other argument; false otherwise.
    • compareTo

      public int compareTo(ConfiguredNode other)
      Specified by:
      compareTo in interface Comparable<ConfiguredNode>
    • 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