Record Class ConnectionError

java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.connection.ConnectionError
Record Components:
kind - what ended it
code - the error code: a transport error code (RFC 9000 section 20) for ConnectionError.Kind.TRANSPORT_ERROR and ConnectionError.Kind.CONNECTION_CLOSED, an application code for ConnectionError.Kind.APPLICATION_CLOSED and ConnectionError.Kind.LOCALLY_CLOSED; 0 otherwise
frameType - the frame type a transport error was about, or 0
reason - the reason phrase, possibly empty

public record ConnectionError(ConnectionError.Kind kind, long code, long frameType, String reason) extends Record
Why a connection ended.
  • Constructor Details

    • ConnectionError

      public ConnectionError(ConnectionError.Kind kind, long code, long frameType, String reason)
      The error.
      Parameters:
      kind - what ended the connection
      code - the error code
      frameType - the frame type, or 0
      reason - the reason phrase
  • Method Details

    • of

      public static ConnectionError of(ConnectionError.Kind kind)
      An error of a kind that has no code.
      Parameters:
      kind - the kind
      Returns:
      the error
    • transport

      public static ConnectionError transport(QuicException e)
      A protocol error this endpoint detected.
      Parameters:
      e - the error
      Returns:
      the error
    • 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.
    • kind

      public ConnectionError.Kind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • code

      public long code()
      Returns the value of the code record component.
      Returns:
      the value of the code record component
    • frameType

      public long frameType()
      Returns the value of the frameType record component.
      Returns:
      the value of the frameType record component
    • reason

      public String reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component