Record Class RPCResultMapper<T>
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.network.rpc.defaults.rpc.RPCResultMapper<T>
- Type Parameters:
T- the generic expected result type of the rpc.
record RPCResultMapper<T>(@NonNull Type expectedResultType, @NonNull ObjectMapper objectMapper)
extends Record
implements Function<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 ObjectMapperThe field for theobjectMapperrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionRPCResultMapper(@NonNull Type expectedResultType, @NonNull ObjectMapper objectMapper) Creates an instance of aRPCResultMapperrecord class. -
Method Summary
Modifier and TypeMethodDescriptionapply(@UnknownNullability 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.Returns the value of theobjectMapperrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
expectedResultType
-
objectMapper
The field for theobjectMapperrecord component.
-
-
Constructor Details
-
RPCResultMapper
RPCResultMapper(@NonNull @NonNull Type expectedResultType, @NonNull @NonNull ObjectMapper objectMapper) Creates an instance of aRPCResultMapperrecord class.- Parameters:
expectedResultType- the value for theexpectedResultTyperecord componentobjectMapper- the value for theobjectMapperrecord component
-
-
Method Details
-
apply
-
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
Returns the value of theobjectMapperrecord component.- Returns:
- the value of the
objectMapperrecord component
-