Record Class DefaultRPCImplementationBuilder.DefaultInstanceAllocator<T>
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.impl.network.rpc.generation.DefaultRPCImplementationBuilder.DefaultInstanceAllocator<T>
- Type Parameters:
T- the type that is being constructed by the allocator.- Record Components:
baseRPC- the base rpc to use for the constructed rpc implementation.classRPCSender- the rpc sender to use for the generated class.channelSupplier- thw channel supplier to use for rpc executions.additionalConstructorParameters- the additional super constructor parameters.internalInstanceFactory- the internal instance factory to delegate to.
- All Implemented Interfaces:
eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T>
- Enclosing class:
DefaultRPCImplementationBuilder<T>
private static record DefaultRPCImplementationBuilder.DefaultInstanceAllocator<T>(@Nullable eu.cloudnetservice.driver.network.rpc.ChainableRPC baseRPC, @NonNull eu.cloudnetservice.driver.network.rpc.RPCSender classRPCSender, @NonNull Supplier<eu.cloudnetservice.driver.network.NetworkChannel> channelSupplier, @NonNull Object[] additionalConstructorParameters, @NonNull RPCInternalInstanceFactory internalInstanceFactory)
extends Record
implements eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T>
The default implementation of an instance allocator using an internal instance factory as delegation.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theadditionalConstructorParametersrecord component.private final @Nullable eu.cloudnetservice.driver.network.rpc.ChainableRPCThe field for thebaseRPCrecord component.The field for thechannelSupplierrecord component.private final @NonNull eu.cloudnetservice.driver.network.rpc.RPCSenderThe field for theclassRPCSenderrecord component.private final @NonNull RPCInternalInstanceFactoryThe field for theinternalInstanceFactoryrecord component. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDefaultInstanceAllocator(@Nullable eu.cloudnetservice.driver.network.rpc.ChainableRPC baseRPC, @NonNull eu.cloudnetservice.driver.network.rpc.RPCSender classRPCSender, @NonNull Supplier<eu.cloudnetservice.driver.network.NetworkChannel> channelSupplier, @NonNull Object[] additionalConstructorParameters, @NonNull RPCInternalInstanceFactory internalInstanceFactory) Creates an instance of aDefaultInstanceAllocatorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theadditionalConstructorParametersrecord component.allocate()@NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> appendConstructorParameters(Object... parameters) @Nullable eu.cloudnetservice.driver.network.rpc.ChainableRPCbaseRPC()Returns the value of thebaseRPCrecord component.@NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> changeConstructorParameter(int index, Object newConstructorParameter) Returns the value of thechannelSupplierrecord component.@NonNull eu.cloudnetservice.driver.network.rpc.RPCSenderReturns the value of theclassRPCSenderrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> insertConstructorParameters(int index, Object... parameters) Returns the value of theinternalInstanceFactoryrecord component.final StringtoString()Returns a string representation of this record class.@NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> withAdditionalConstructorParameters(Object... additionalConstructorParams) @NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> withBaseRPC(@Nullable eu.cloudnetservice.driver.network.rpc.ChainableRPC baseRPC) @NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> withTargetChannel(@NonNull Supplier<eu.cloudnetservice.driver.network.NetworkChannel> channelSupplier)
-
Field Details
-
baseRPC
-
classRPCSender
The field for theclassRPCSenderrecord component. -
channelSupplier
@NonNull private final @NonNull Supplier<eu.cloudnetservice.driver.network.NetworkChannel> channelSupplierThe field for thechannelSupplierrecord component. -
additionalConstructorParameters
The field for theadditionalConstructorParametersrecord component. -
internalInstanceFactory
The field for theinternalInstanceFactoryrecord component.
-
-
Constructor Details
-
DefaultInstanceAllocator
private DefaultInstanceAllocator(@Nullable @Nullable eu.cloudnetservice.driver.network.rpc.ChainableRPC baseRPC, @NonNull @NonNull eu.cloudnetservice.driver.network.rpc.RPCSender classRPCSender, @NonNull @NonNull Supplier<eu.cloudnetservice.driver.network.NetworkChannel> channelSupplier, @NonNull @NonNull Object[] additionalConstructorParameters, @NonNull @NonNull RPCInternalInstanceFactory internalInstanceFactory) Creates an instance of aDefaultInstanceAllocatorrecord class.- Parameters:
baseRPC- the value for thebaseRPCrecord componentclassRPCSender- the value for theclassRPCSenderrecord componentchannelSupplier- the value for thechannelSupplierrecord componentadditionalConstructorParameters- the value for theadditionalConstructorParametersrecord componentinternalInstanceFactory- the value for theinternalInstanceFactoryrecord component
-
-
Method Details
-
withBaseRPC
@NonNull public @NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> withBaseRPC(@Nullable @Nullable eu.cloudnetservice.driver.network.rpc.ChainableRPC baseRPC) - Specified by:
withBaseRPCin interfaceeu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T>
-
withTargetChannel
@NonNull public @NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> withTargetChannel(@NonNull @NonNull Supplier<eu.cloudnetservice.driver.network.NetworkChannel> channelSupplier) - Specified by:
withTargetChannelin interfaceeu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T>
-
withAdditionalConstructorParameters
@NonNull public @NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> withAdditionalConstructorParameters(Object... additionalConstructorParams) - Specified by:
withAdditionalConstructorParametersin interfaceeu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T>
-
changeConstructorParameter
@NonNull public @NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> changeConstructorParameter(int index, Object newConstructorParameter) - Specified by:
changeConstructorParameterin interfaceeu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T>
-
insertConstructorParameters
@NonNull public @NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> insertConstructorParameters(int index, Object... parameters) - Specified by:
insertConstructorParametersin interfaceeu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T>
-
appendConstructorParameters
@NonNull public @NonNull eu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T> appendConstructorParameters(Object... parameters) - Specified by:
appendConstructorParametersin interfaceeu.cloudnetservice.driver.network.rpc.factory.RPCImplementationBuilder.InstanceAllocator<T>
-
allocate
-
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). -
baseRPC
-
classRPCSender
Returns the value of theclassRPCSenderrecord component.- Returns:
- the value of the
classRPCSenderrecord component
-
channelSupplier
@NonNull public @NonNull Supplier<eu.cloudnetservice.driver.network.NetworkChannel> channelSupplier()Returns the value of thechannelSupplierrecord component.- Returns:
- the value of the
channelSupplierrecord component
-
additionalConstructorParameters
Returns the value of theadditionalConstructorParametersrecord component.- Returns:
- the value of the
additionalConstructorParametersrecord component
-
internalInstanceFactory
Returns the value of theinternalInstanceFactoryrecord component.- Returns:
- the value of the
internalInstanceFactoryrecord component
-