Record Class IPBabelNodeComponent
java.lang.Object
java.lang.Record
pt.unl.fct.di.novasys.babel2.channels.IPBabelNodeComponent
- Record Components:
channelName- the name of the network channel associated with this componentaddress- the socket address that uniquely identifies this node on the network
- All Implemented Interfaces:
BabelNodeComponent
public record IPBabelNodeComponent(String channelName, InetSocketAddress address)
extends Record
implements BabelNodeComponent
Immutable record that identifies a Babel node by its IP-level socket address.
Instances are serialized on the wire by
IPBabelNodeComponentSerialiazer, which encodes
the address family (4 or 16 bytes), the raw address bytes, and the port as a 4-byte integer.
A null node is encoded as a single zero byte.
-
Constructor Summary
ConstructorsConstructorDescriptionIPBabelNodeComponent(String channelName, InetSocketAddress address) Creates an instance of aIPBabelNodeComponentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionaddress()Returns the value of theaddressrecord component.Returns the value of thechannelNamerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
IPBabelNodeComponent
Creates an instance of aIPBabelNodeComponentrecord class.- Parameters:
channelName- the value for thechannelNamerecord componentaddress- the value for theaddressrecord component
-
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
channelName
Returns the value of thechannelNamerecord component.- Returns:
- the value of the
channelNamerecord component
-
address
-