Record Class DirectPeerInfo
java.lang.Object
java.lang.Record
io.helidon.webserver.testing.junit5.DirectPeerInfo
- Record Components:
address
- socket address - socket address of the peerhost
- host - for network, this is the used host of the peerport
- port - for network, this is the used port of the peertlsPrincipal
- principal - for network obtained from SSL handshake or configuration (if used)tlsCertificates
- certificates - for network obtained from SSL handshake or configuration
- All Implemented Interfaces:
PeerInfo
public record DirectPeerInfo(SocketAddress address, String host, int port, Optional<Principal> tlsPrincipal, Optional<Certificate[]> tlsCertificates)
extends Record
implements PeerInfo
Peer information that can be used with
DirectSocket
.-
Constructor Summary
ConstructorDescriptionDirectPeerInfo
(SocketAddress address, String host, int port, Optional<Principal> tlsPrincipal, Optional<Certificate[]> tlsCertificates) Creates an instance of aDirectPeerInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionaddress()
Returns the value of theaddress
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.host()
Returns the value of thehost
record component.int
port()
Returns the value of theport
record component.Returns the value of thetlsCertificates
record component.Returns the value of thetlsPrincipal
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
DirectPeerInfo
public DirectPeerInfo(SocketAddress address, String host, int port, Optional<Principal> tlsPrincipal, Optional<Certificate[]> tlsCertificates) Creates an instance of aDirectPeerInfo
record class.- Parameters:
address
- the value for theaddress
record componenthost
- the value for thehost
record componentport
- the value for theport
record componenttlsPrincipal
- the value for thetlsPrincipal
record componenttlsCertificates
- the value for thetlsCertificates
record component
-
-
Method Details
-
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. -
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. -
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 '=='. -
address
Returns the value of theaddress
record component. -
host
Returns the value of thehost
record component. -
port
public int port()Returns the value of theport
record component. -
tlsPrincipal
Returns the value of thetlsPrincipal
record component.- Specified by:
tlsPrincipal
in interfacePeerInfo
- Returns:
- the value of the
tlsPrincipal
record component
-
tlsCertificates
Returns the value of thetlsCertificates
record component.- Specified by:
tlsCertificates
in interfacePeerInfo
- Returns:
- the value of the
tlsCertificates
record component
-