Package net.minecraft.server.jsonrpc
Record Class OutgoingRpcMethod.Method<Params,Result>
java.lang.Object
java.lang.Record
net.minecraft.server.jsonrpc.OutgoingRpcMethod.Method<Params,Result>
- All Implemented Interfaces:
OutgoingRpcMethod<Params,Result>
- Enclosing interface:
OutgoingRpcMethod<Params,Result>
public static record OutgoingRpcMethod.Method<Params,Result> (MethodInfo info, OutgoingRpcMethod.Attributes attributes, com.mojang.serialization.Codec<Params> paramsCodec, com.mojang.serialization.Codec<Result> resultCodec)
extends Record
implements OutgoingRpcMethod<Params,Result>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.server.jsonrpc.OutgoingRpcMethod
OutgoingRpcMethod.Attributes, OutgoingRpcMethod.Factory<T extends OutgoingRpcMethod<?,?>>, OutgoingRpcMethod.Method<Params, Result>, OutgoingRpcMethod.Notification<Params>, OutgoingRpcMethod.OutgoingRpcMethodBuilder<T extends OutgoingRpcMethod<?, ?>>, OutgoingRpcMethod.ParameterlessMethod<Result>, OutgoingRpcMethod.ParmeterlessNotification -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final OutgoingRpcMethod.AttributesThe field for theattributesrecord component.private final MethodInfoThe field for theinforecord component.private final com.mojang.serialization.Codec<Params> The field for theparamsCodecrecord component.private final com.mojang.serialization.Codec<Result> The field for theresultCodecrecord component.Fields inherited from interface net.minecraft.server.jsonrpc.OutgoingRpcMethod
NOTIFICATION_PREFIX -
Constructor Summary
ConstructorsConstructorDescriptionMethod(MethodInfo info, OutgoingRpcMethod.Attributes attributes, com.mojang.serialization.Codec<Params> paramsCodec, com.mojang.serialization.Codec<Result> resultCodec) Creates an instance of aMethodrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.decodeResult(JsonElement p_442832_) encodeParams(Params p_442798_) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.info()Returns the value of theinforecord component.com.mojang.serialization.Codec<Params> Returns the value of theparamsCodecrecord component.com.mojang.serialization.Codec<Result> Returns the value of theresultCodecrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
info
The field for theinforecord component. -
attributes
The field for theattributesrecord component. -
paramsCodec
The field for theparamsCodecrecord component. -
resultCodec
The field for theresultCodecrecord component.
-
-
Constructor Details
-
Method
public Method(MethodInfo info, OutgoingRpcMethod.Attributes attributes, com.mojang.serialization.Codec<Params> paramsCodec, com.mojang.serialization.Codec<Result> resultCodec) Creates an instance of aMethodrecord class.- Parameters:
info- the value for theinforecord componentattributes- the value for theattributesrecord componentparamsCodec- the value for theparamsCodecrecord componentresultCodec- the value for theresultCodecrecord component
-
-
Method Details
-
encodeParams
- Specified by:
encodeParamsin interfaceOutgoingRpcMethod<Params,Result>
-
decodeResult
- Specified by:
decodeResultin interfaceOutgoingRpcMethod<Params,Result>
-
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. -
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. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
info
Returns the value of theinforecord component.- Specified by:
infoin interfaceOutgoingRpcMethod<Params,Result> - Returns:
- the value of the
inforecord component
-
attributes
Returns the value of theattributesrecord component.- Specified by:
attributesin interfaceOutgoingRpcMethod<Params,Result> - Returns:
- the value of the
attributesrecord component
-
paramsCodec
Returns the value of theparamsCodecrecord component.- Returns:
- the value of the
paramsCodecrecord component
-
resultCodec
Returns the value of theresultCodecrecord component.- Returns:
- the value of the
resultCodecrecord component
-