Module concord_core

Record Class MoveToChannel

java.lang.Object
java.lang.Record
nl.andrewl.concord_core.msg.types.channel.MoveToChannel
Record Components:
id - The id of the channel that the client is requesting or being moved to, or the id of another client that the user wishes to begin private messaging with.
channelName - The name of the channel that the client is moved to. This is null in cases where the client is requesting to move to a channel, and is only provided by the server when it moves a client.
All Implemented Interfaces:
Message

public record MoveToChannel(UUID id, String channelName) extends Record implements Message
A message that's sent to a client when they've been moved to another channel. This indicates to the client that they should perform the necessary requests to update their view to indicate that they're now in a different channel.

Conversely, a client can send this request to the server to indicate that they would like to switch to the specified channel.

Clients can also send this message and provide the id of another client to request that they enter a private message channel with the referenced client.

  • Field Details

    • id

      private final UUID id
      The field for the id record component.
    • channelName

      private final String channelName
      The field for the channelName record component.
  • Constructor Details

    • MoveToChannel

      public MoveToChannel(UUID id)
    • MoveToChannel

      public MoveToChannel(UUID id, String channelName)
      Creates an instance of a MoveToChannel record class.
      Parameters:
      id - the value for the id record component
      channelName - the value for the channelName 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • id

      public UUID id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • channelName

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