Package com.usatiuk.dhfs.peerdiscovery

# Record Class IpPeerAddress

java.lang.Object
java.lang.Record
com.usatiuk.dhfs.peerdiscovery.IpPeerAddress

All Implemented Interfaces:
  `PeerAddress`, `Serializable`

public record IpPeerAddress(PeerId peer, PeerAddressType type, InetAddress address, int port, int securePort) extends Record implements PeerAddress

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`IpPeerAddress(PeerId peer, PeerAddressType type, InetAddress address, int port, int securePort)`
Creates an instance of a `IpPeerAddress` record class.

## Method Summary

Modifier and Type
Method
Description
`InetAddress`
`address()`
Returns the value of the `address` record component.
`final boolean`
`equals(Object o)`
Indicates whether some other object is "equal to" this one.
`final int`
`hashCode()`
Returns a hash code value for this object.
`PeerId`
`peer()`
Returns the value of the `peer` record component.
`int`
`port()`
Returns the value of the `port` record component.
`int`
`securePort()`
Returns the value of the `securePort` record component.
`String`
`toString()`
Returns a string representation of this record class.
`PeerAddressType`
`type()`
Returns the value of the `type` record component.
`IpPeerAddress`
`withType(PeerAddressType type)`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### IpPeerAddress

public IpPeerAddress(PeerId peer, PeerAddressType type, InetAddress address, int port, int securePort)
Creates an instance of a `IpPeerAddress` record class.

Parameters:
  `peer` - the value for the `peer` record component
  `type` - the value for the `type` record component
  `address` - the value for the `address` record component
  `port` - the value for the `port` record component
  `securePort` - the value for the `securePort` record component

## Method Details

### withType

public IpPeerAddress withType(PeerAddressType type)

### toString

public 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

### hashCode

public final 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 final boolean equals(Object o)
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 with `Objects::equals(Object,Object)`; primitive components are compared with '=='.

Specified by:
  `equals` in class `Record`
Parameters:
  `o` - the object with which to compare
Returns:
  `true` if this object is the same as the `o` argument; `false` otherwise.

### peer

public PeerId peer()
Returns the value of the `peer` record component.

Specified by:
  `peer` in interface `PeerAddress`
Returns:
  the value of the `peer` record component

### type

public PeerAddressType type()
Returns the value of the `type` record component.

Specified by:
  `type` in interface `PeerAddress`
Returns:
  the value of the `type` record component

### address

public InetAddress address()
Returns the value of the `address` record component.

Returns:
  the value of the `address` record component

### port

public int port()
Returns the value of the `port` record component.

Returns:
  the value of the `port` record component

### securePort

public int securePort()
Returns the value of the `securePort` record component.

Returns:
  the value of the `securePort` record component