Record Class DirectPeerInfo

java.lang.Object
java.lang.Record
io.helidon.webserver.testing.junit5.DirectPeerInfo
Record Components:
address - socket address - socket address of the peer
host - host - for network, this is the used host of the peer
port - port - for network, this is the used port of the peer
tlsPrincipal - 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 Details

    • DirectPeerInfo

      public DirectPeerInfo(SocketAddress address, String host, int port, Optional<Principal> tlsPrincipal, Optional<Certificate[]> tlsCertificates)
      Creates an instance of a DirectPeerInfo record class.
      Parameters:
      address - the value for the address record component
      host - the value for the host record component
      port - the value for the port record component
      tlsPrincipal - the value for the tlsPrincipal record component
      tlsCertificates - the value for the tlsCertificates record component
  • Method Details

    • toString

      public final 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.
    • address

      public SocketAddress address()
      Returns the value of the address record component.
      Specified by:
      address in interface PeerInfo
      Returns:
      the value of the address record component
    • host

      public String host()
      Returns the value of the host record component.
      Specified by:
      host in interface PeerInfo
      Returns:
      the value of the host record component
    • port

      public int port()
      Returns the value of the port record component.
      Specified by:
      port in interface PeerInfo
      Returns:
      the value of the port record component
    • tlsPrincipal

      public Optional<Principal> tlsPrincipal()
      Returns the value of the tlsPrincipal record component.
      Specified by:
      tlsPrincipal in interface PeerInfo
      Returns:
      the value of the tlsPrincipal record component
    • tlsCertificates

      public Optional<Certificate[]> tlsCertificates()
      Returns the value of the tlsCertificates record component.
      Specified by:
      tlsCertificates in interface PeerInfo
      Returns:
      the value of the tlsCertificates record component