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
ConstructorsConstructorDescriptionDirectPeerInfo(SocketAddress address, String host, int port, Optional<Principal> tlsPrincipal, Optional<Certificate[]> tlsCertificates) Creates an instance of aDirectPeerInforecord 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.host()Returns the value of thehostrecord component.intport()Returns the value of theportrecord component.Returns the value of thetlsCertificatesrecord component.Returns the value of thetlsPrincipalrecord component.final StringtoString()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 aDirectPeerInforecord class.- Parameters:
address- the value for theaddressrecord componenthost- the value for thehostrecord componentport- the value for theportrecord componenttlsPrincipal- the value for thetlsPrincipalrecord componenttlsCertificates- the value for thetlsCertificatesrecord 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 theaddressrecord component. -
host
Returns the value of thehostrecord component. -
port
public int port()Returns the value of theportrecord component. -
tlsPrincipal
Returns the value of thetlsPrincipalrecord component.- Specified by:
tlsPrincipalin interfacePeerInfo- Returns:
- the value of the
tlsPrincipalrecord component
-
tlsCertificates
Returns the value of thetlsCertificatesrecord component.- Specified by:
tlsCertificatesin interfacePeerInfo- Returns:
- the value of the
tlsCertificatesrecord component
-