Record Class FixedInstanceServiceRegistration<S>
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.impl.registry.FixedInstanceServiceRegistration<S>
- Type Parameters:
S- the type modeling the implemented service.- Record Components:
serviceType- the type of the service that is implemented by this registration.serviceName- the name of the service registration.serviceInstance- the instance that is mapped in this registration.binding- the binding in which this registration is registered.
- All Implemented Interfaces:
eu.cloudnetservice.driver.base.Named, eu.cloudnetservice.driver.registry.ServiceRegistryRegistration<S>, jakarta.inject.Provider<S>
record FixedInstanceServiceRegistration<S>(@NonNull Class<S> serviceType, @NonNull String serviceName, S serviceInstance, @NonNull ServiceRegistrationsBinding<S> binding)
extends Record
implements eu.cloudnetservice.driver.registry.ServiceRegistryRegistration<S>
A service registration that returns a single, fixed instance when retrieved.
- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NonNull ServiceRegistrationsBinding<S> The field for thebindingrecord component.private final SThe field for theserviceInstancerecord component.The field for theserviceNamerecord component.The field for theserviceTyperecord component. -
Constructor Summary
ConstructorsConstructorDescriptionFixedInstanceServiceRegistration(@NonNull Class<S> serviceType, @NonNull String serviceName, S serviceInstance, @NonNull ServiceRegistrationsBinding<S> binding) Creates an instance of aFixedInstanceServiceRegistrationrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbinding()Returns the value of thebindingrecord component.booleanfinal booleanIndicates whether some other object is "equal to" this one.get()final inthashCode()Returns a hash code value for this object.voidname()Returns the value of theserviceInstancerecord component.Returns the value of theserviceNamerecord component.Returns the value of theserviceTyperecord component.final StringtoString()Returns a string representation of this record class.booleanbooleanvalid()
-
Field Details
-
serviceType
The field for theserviceTyperecord component. -
serviceName
The field for theserviceNamerecord component. -
serviceInstance
The field for theserviceInstancerecord component. -
binding
The field for thebindingrecord component.
-
-
Constructor Details
-
FixedInstanceServiceRegistration
FixedInstanceServiceRegistration(@NonNull @NonNull Class<S> serviceType, @NonNull @NonNull String serviceName, @NonNull S serviceInstance, @NonNull @NonNull ServiceRegistrationsBinding<S> binding) Creates an instance of aFixedInstanceServiceRegistrationrecord class.- Parameters:
serviceType- the value for theserviceTyperecord componentserviceName- the value for theserviceNamerecord componentserviceInstance- the value for theserviceInstancerecord componentbinding- the value for thebindingrecord component
-
-
Method Details
-
defaultService
public boolean defaultService()- Specified by:
defaultServicein interfaceeu.cloudnetservice.driver.registry.ServiceRegistryRegistration<S>
-
markAsDefaultService
public void markAsDefaultService()- Specified by:
markAsDefaultServicein interfaceeu.cloudnetservice.driver.registry.ServiceRegistryRegistration<S>
-
valid
public boolean valid()- Specified by:
validin interfaceeu.cloudnetservice.driver.registry.ServiceRegistryRegistration<S>
-
unregister
public boolean unregister()- Specified by:
unregisterin interfaceeu.cloudnetservice.driver.registry.ServiceRegistryRegistration<S>
-
get
-
name
-
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). -
serviceType
Returns the value of theserviceTyperecord component.- Specified by:
serviceTypein interfaceeu.cloudnetservice.driver.registry.ServiceRegistryRegistration<S>- Returns:
- the value of the
serviceTyperecord component
-
serviceName
Returns the value of theserviceNamerecord component.- Returns:
- the value of the
serviceNamerecord component
-
serviceInstance
Returns the value of theserviceInstancerecord component.- Specified by:
serviceInstancein interfaceeu.cloudnetservice.driver.registry.ServiceRegistryRegistration<S>- Returns:
- the value of the
serviceInstancerecord component
-
binding
-