Record Class Server

java.lang.Object
java.lang.Record
com.iohao.net.framework.protocol.Server

public record Server(int id, String name, String tag, ServerTypeEnum serverType, int netId, String ip, String pubName, int[] cmdMerges, Map<String,byte[]> payloadMap, BarSkeleton barSkeleton) extends Record
Server
Since:
25.1
Author:
渔民小镇
date:
2025-09-08
  • Constructor Details

    • Server

      public Server(int id, String name, String tag, ServerTypeEnum serverType, int netId, String ip, String pubName, int[] cmdMerges, Map<String,byte[]> payloadMap, BarSkeleton barSkeleton)
      Creates an instance of a Server record class.
      Parameters:
      id - the value for the id record component
      name - the value for the name record component
      tag - the value for the tag record component
      serverType - the value for the serverType record component
      netId - the value for the netId record component
      ip - the value for the ip record component
      pubName - the value for the pubName record component
      cmdMerges - the value for the cmdMerges record component
      payloadMap - the value for the payloadMap record component
      barSkeleton - the value for the barSkeleton record component
  • Method Details

    • getPayload

      public byte[] getPayload(String name)
    • addPayload

      public void addPayload(String name, byte[] data)
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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
    • id

      public int id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • tag

      public String tag()
      Returns the value of the tag record component.
      Returns:
      the value of the tag record component
    • serverType

      public ServerTypeEnum serverType()
      Returns the value of the serverType record component.
      Returns:
      the value of the serverType record component
    • netId

      public int netId()
      Returns the value of the netId record component.
      Returns:
      the value of the netId record component
    • ip

      public String ip()
      Returns the value of the ip record component.
      Returns:
      the value of the ip record component
    • pubName

      public String pubName()
      Returns the value of the pubName record component.
      Returns:
      the value of the pubName record component
    • cmdMerges

      public int[] cmdMerges()
      Returns the value of the cmdMerges record component.
      Returns:
      the value of the cmdMerges record component
    • payloadMap

      public Map<String,byte[]> payloadMap()
      Returns the value of the payloadMap record component.
      Returns:
      the value of the payloadMap record component
    • barSkeleton

      public BarSkeleton barSkeleton()
      Returns the value of the barSkeleton record component.
      Returns:
      the value of the barSkeleton record component