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>
  • Field Details

    • info

      private final MethodInfo info
      The field for the info record component.
    • attributes

      private final OutgoingRpcMethod.Attributes attributes
      The field for the attributes record component.
    • paramsCodec

      private final com.mojang.serialization.Codec<Params> paramsCodec
      The field for the paramsCodec record component.
    • resultCodec

      private final com.mojang.serialization.Codec<Result> resultCodec
      The field for the resultCodec record 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 a Method record class.
      Parameters:
      info - the value for the info record component
      attributes - the value for the attributes record component
      paramsCodec - the value for the paramsCodec record component
      resultCodec - the value for the resultCodec record component
  • Method Details

    • encodeParams

      @Nullable public JsonElement encodeParams(Params p_442798_)
      Specified by:
      encodeParams in interface OutgoingRpcMethod<Params,Result>
    • decodeResult

      public Result decodeResult(JsonElement p_442832_)
      Specified by:
      decodeResult in interface OutgoingRpcMethod<Params,Result>
    • 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.
    • info

      public MethodInfo info()
      Returns the value of the info record component.
      Specified by:
      info in interface OutgoingRpcMethod<Params,Result>
      Returns:
      the value of the info record component
    • attributes

      public OutgoingRpcMethod.Attributes attributes()
      Returns the value of the attributes record component.
      Specified by:
      attributes in interface OutgoingRpcMethod<Params,Result>
      Returns:
      the value of the attributes record component
    • paramsCodec

      public com.mojang.serialization.Codec<Params> paramsCodec()
      Returns the value of the paramsCodec record component.
      Returns:
      the value of the paramsCodec record component
    • resultCodec

      public com.mojang.serialization.Codec<Result> resultCodec()
      Returns the value of the resultCodec record component.
      Returns:
      the value of the resultCodec record component