Record Class CmdInfo

java.lang.Object
java.lang.Record
com.iohao.net.framework.core.CmdInfo

public record CmdInfo(int cmd, int subCmd, int cmdMerge) extends Record
CmdInfo
Author:
渔民小镇
date:
2021-12-20
  • Constructor Summary

    Constructors
    Constructor
    Description
    CmdInfo(int cmd, int subCmd, int cmdMerge)
    Creates an instance of a CmdInfo record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    cmd()
    Returns the value of the cmd record component.
    int
    Returns the value of the cmdMerge record component.
    boolean
    equals(Object object)
    Indicates whether some other object is "equal to" this one.
    int
    Returns a hash code value for this object.
    static CmdInfo
    of(int cmdMerge)
     
    static CmdInfo
    of(int cmd, int subCmd)
     
    int
    Returns the value of the subCmd record component.
    @NonNull String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • CmdInfo

      public CmdInfo(int cmd, int subCmd, int cmdMerge)
      Creates an instance of a CmdInfo record class.
      Parameters:
      cmd - the value for the cmd record component
      subCmd - the value for the subCmd record component
      cmdMerge - the value for the cmdMerge record component
  • Method Details

    • of

      public static CmdInfo of(int cmd, int subCmd)
    • of

      public static CmdInfo of(int cmdMerge)
    • equals

      public boolean equals(Object object)
      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:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • hashCode

      public 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
    • toString

      public @NonNull 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
    • cmd

      public int cmd()
      Returns the value of the cmd record component.
      Returns:
      the value of the cmd record component
    • subCmd

      public int subCmd()
      Returns the value of the subCmd record component.
      Returns:
      the value of the subCmd record component
    • cmdMerge

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