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 Summary
ConstructorsConstructorDescriptionServer(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 aServerrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPayload(String name, byte[] data) Returns the value of thebarSkeletonrecord component.int[]Returns the value of thecmdMergesrecord component.booleanIndicates whether some other object is "equal to" this one.byte[]getPayload(String name) inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.ip()Returns the value of theiprecord component.name()Returns the value of thenamerecord component.intnetId()Returns the value of thenetIdrecord component.Returns the value of thepayloadMaprecord component.pubName()Returns the value of thepubNamerecord component.Returns the value of theserverTyperecord component.tag()Returns the value of thetagrecord component.@NonNull StringtoString()Returns a string representation of this record class.
-
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 aServerrecord class.- Parameters:
id- the value for theidrecord componentname- the value for thenamerecord componenttag- the value for thetagrecord componentserverType- the value for theserverTyperecord componentnetId- the value for thenetIdrecord componentip- the value for theiprecord componentpubName- the value for thepubNamerecord componentcmdMerges- the value for thecmdMergesrecord componentpayloadMap- the value for thepayloadMaprecord componentbarSkeleton- the value for thebarSkeletonrecord component
-
-
Method Details
-
getPayload
-
addPayload
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
hashCode
-
toString
-
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
tag
Returns the value of thetagrecord component.- Returns:
- the value of the
tagrecord component
-
serverType
Returns the value of theserverTyperecord component.- Returns:
- the value of the
serverTyperecord component
-
netId
public int netId()Returns the value of thenetIdrecord component.- Returns:
- the value of the
netIdrecord component
-
ip
Returns the value of theiprecord component.- Returns:
- the value of the
iprecord component
-
pubName
Returns the value of thepubNamerecord component.- Returns:
- the value of the
pubNamerecord component
-
cmdMerges
public int[] cmdMerges()Returns the value of thecmdMergesrecord component.- Returns:
- the value of the
cmdMergesrecord component
-
payloadMap
-
barSkeleton
Returns the value of thebarSkeletonrecord component.- Returns:
- the value of the
barSkeletonrecord component
-