Package com.yahoo.vdslib.distribution
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
ConstructorsConstructorDescriptionConfiguredNode(int index, boolean retired) Creates an instance of aConfiguredNoderecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ConfiguredNode other) booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.intindex()Return the index (distribution key) of this nodebooleanretired()Returns whether the node is configured to be retiredfinal StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConfiguredNode
public ConfiguredNode(int index, boolean retired) Creates an instance of aConfiguredNoderecord class.- Parameters:
index- the value for theindexrecord componentretired- the value for theretiredrecord 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. -
equals
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 '=='. -
compareTo
- Specified by:
compareToin interfaceComparable<ConfiguredNode>
-
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.
-