Record Class PeerAddress
java.lang.Object
java.lang.Record
com.loomcache.server.discovery.PeerAddress
- Record Components:
nodeId- unique node identifier (must not be null)host- IP address or hostname (must not be null)port- TCP port number (7654 by default for LoomCache member traffic)memberAttributes- optional topology/member attributes from discovery
public record PeerAddress(String nodeId, String host, int port, MemberAttributes memberAttributes)
extends Record
Immutable record representing a discovered peer address in the cluster.
Used by discovery strategies to return information about discovered peers. All fields are non-null after construction.
-
Constructor Summary
ConstructorsConstructorDescriptionPeerAddress(String nodeId, String host, int port) PeerAddress(String nodeId, String host, int port, MemberAttributes memberAttributes) Compact constructor for validation. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.host()Returns the value of thehostrecord component.Returns the value of thememberAttributesrecord component.nodeId()Returns the value of thenodeIdrecord component.intport()Returns the value of theportrecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
PeerAddress
-
PeerAddress
Compact constructor for validation.- Throws:
IllegalArgumentException- if nodeId or host is null/blank
-
-
Method Details
-
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
-
host
-
port
-
memberAttributes
Returns the value of thememberAttributesrecord component.- Returns:
- the value of the
memberAttributesrecord component
-