Package net.minecraft.server.jsonrpc
Record Class PendingRpcRequest<Result>
java.lang.Object
java.lang.Record
net.minecraft.server.jsonrpc.PendingRpcRequest<Result>
public record PendingRpcRequest<Result>(Holder.Reference<? extends OutgoingRpcMethod<?,? extends Result>> method, CompletableFuture<Result> resultFuture, long timeoutTime)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Holder.Reference<? extends OutgoingRpcMethod<?, ? extends Result>> The field for themethodrecord component.private final CompletableFuture<Result> The field for theresultFuturerecord component.private final longThe field for thetimeoutTimerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionPendingRpcRequest(Holder.Reference<? extends OutgoingRpcMethod<?, ? extends Result>> method, CompletableFuture<Result> resultFuture, long timeoutTime) Creates an instance of aPendingRpcRequestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(JsonElement pJson) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Holder.Reference<? extends OutgoingRpcMethod<?, ? extends Result>> method()Returns the value of themethodrecord component.Returns the value of theresultFuturerecord component.booleantimedOut(long pTime) longReturns the value of thetimeoutTimerecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
method
The field for themethodrecord component. -
resultFuture
The field for theresultFuturerecord component. -
timeoutTime
private final long timeoutTimeThe field for thetimeoutTimerecord component.
-
-
Constructor Details
-
PendingRpcRequest
public PendingRpcRequest(Holder.Reference<? extends OutgoingRpcMethod<?, ? extends Result>> method, CompletableFuture<Result> resultFuture, long timeoutTime) Creates an instance of aPendingRpcRequestrecord class.- Parameters:
method- the value for themethodrecord componentresultFuture- the value for theresultFuturerecord componenttimeoutTime- the value for thetimeoutTimerecord component
-
-
Method Details
-
accept
-
timedOut
public boolean timedOut(long pTime) -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
resultFuture
Returns the value of theresultFuturerecord component.- Returns:
- the value of the
resultFuturerecord component
-
timeoutTime
public long timeoutTime()Returns the value of thetimeoutTimerecord component.- Returns:
- the value of the
timeoutTimerecord component
-