Record Class FirstHandshakeSimpleClientMessage

java.lang.Object
java.lang.Record
pt.unl.fct.di.novasys.babel2.channels.legacy.simpleServer.messages.FirstHandshakeSimpleClientMessage
Record Components:
magicNumber - the client magic number identifying the legacy protocol version
All Implemented Interfaces:
ControlMessage

public record FirstHandshakeSimpleClientMessage(int magicNumber) extends Record implements ControlMessage
Initial handshake message sent by a legacy simple client containing its client magic number.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Integer type identifier for the first client handshake message.

    Fields inherited from interface ControlMessage

    CONTROL_MAGIC_NUMBER
    Modifier and Type
    Field
    Description
    static final int
    Magic number used to identify legacy control protocol frames.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of a FirstHandshakeSimpleClientMessage record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the count of attributes carried in this control message envelope.
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the integer type identifier of this control message.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the magicNumber record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • TYPE_INT

      public static final int TYPE_INT
      Integer type identifier for the first client handshake message.
      See Also:
  • Constructor Details

    • FirstHandshakeSimpleClientMessage

      public FirstHandshakeSimpleClientMessage(int magicNumber)
      Creates an instance of a FirstHandshakeSimpleClientMessage record class.
      Parameters:
      magicNumber - the value for the magicNumber record component
  • Method Details

    • getTypeInt

      public int getTypeInt()
      Description copied from interface: ControlMessage
      Returns the integer type identifier of this control message.
      Specified by:
      getTypeInt in interface ControlMessage
      Returns:
      the message type code
    • attributeMapSize

      public int attributeMapSize()
      Description copied from interface: ControlMessage
      Returns the count of attributes carried in this control message envelope.
      Specified by:
      attributeMapSize in interface ControlMessage
      Returns:
      the attribute map size
    • 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. All components in this record class are compared with the compare method from their corresponding wrapper classes.
      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.
    • magicNumber

      public int magicNumber()
      Returns the value of the magicNumber record component.
      Returns:
      the value of the magicNumber record component