Record Class NodeEndpoint
java.lang.Object
java.lang.Record
com.loomcache.client.NodeEndpoint
- Record Components:
nodeId- unique identifier for the node (host:port format, must not be null)address- hostname or IP address of the node (must not be null)port- port number of the nodeweight- relative weight for load balancing (higher = more traffic, default 1)healthy- whether the node is currently considered healthy
-
Constructor Summary
ConstructorsConstructorDescriptionNodeEndpoint(String nodeId, String address, int port, int weight, boolean healthy) Creates an instance of aNodeEndpointrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaddress()Returns the value of theaddressrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhealthy()Returns the value of thehealthyrecord component.nodeId()Returns the value of thenodeIdrecord component.static NodeEndpointCreate a NodeEndpoint with default weight of 1.static NodeEndpointCreate a NodeEndpoint with specified weight.static NodeEndpointCreate a NodeEndpoint with health status.intport()Returns the value of theportrecord component.toString()Returns a string representation of this record class.intweight()Returns the value of theweightrecord component.
-
Constructor Details
-
NodeEndpoint
Creates an instance of aNodeEndpointrecord class.
-
-
Method Details
-
of
Create a NodeEndpoint with default weight of 1. -
of
Create a NodeEndpoint with specified weight. -
of
Create a NodeEndpoint with health status. -
toString
-
hashCode
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
nodeId
-
address
-
port
-
weight
-
healthy
-