Record Class RPCResultMapper<T>
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.impl.network.rpc.rpc.RPCResultMapper<T>
- Type Parameters:
T- the generic expected result type of the rpc.
- All Implemented Interfaces:
Function<eu.cloudnetservice.driver.network.protocol.Packet, T>
record RPCResultMapper<T>(@NonNull Type expectedResultType, @NonNull eu.cloudnetservice.driver.network.object.ObjectMapper objectMapper)
extends Record
implements Function<eu.cloudnetservice.driver.network.protocol.Packet, T>
The shared mapping function between the rpc chain and default rpc handling the result of a remote code execution and
mapping the result in a convenient way.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theexpectedResultTyperecord component.private final @NonNull eu.cloudnetservice.driver.network.object.ObjectMapperThe field for theobjectMapperrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRPCResultMapper(@NonNull Type expectedResultType, @NonNull eu.cloudnetservice.driver.network.object.ObjectMapper objectMapper) Creates an instance of aRPCResultMapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapply(@UnknownNullability eu.cloudnetservice.driver.network.protocol.Packet response) final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpectedResultTyperecord component.final inthashCode()Returns a hash code value for this object.@NonNull eu.cloudnetservice.driver.network.object.ObjectMapperReturns the value of theobjectMapperrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
expectedResultType
-
objectMapper
-
-
Constructor Details
-
RPCResultMapper
RPCResultMapper(@NonNull @NonNull Type expectedResultType, @NonNull @NonNull eu.cloudnetservice.driver.network.object.ObjectMapper objectMapper) Creates an instance of aRPCResultMapperrecord class.- Parameters:
expectedResultType- the value for theexpectedResultTyperecord componentobjectMapper- the value for theobjectMapperrecord component
-
-
Method Details
-
apply
public @UnknownNullability T apply(@UnknownNullability eu.cloudnetservice.driver.network.protocol.Packet response) -
toString
-
hashCode
-
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). -
expectedResultType
-
objectMapper
-