- All Superinterfaces:
Comparable<Weighted>
- All Known Implementing Classes:
io.helidon.inject.runtime.AbstractServiceProvider,AccessLogRoutingFeature,AsyncImpl$$Injection$$Activator,BulkheadImpl$$Injection$$Activator,CircuitBreakerImpl$$Injection$$Activator,io.helidon.inject.configdriven.runtime.ConfigDrivenServiceProviderBase,ConfigProducer$$Injection$$Activator,DefaultOciCertificatesDownloader$$Injection$$Activator,DefaultOciPrivateKeyDownloader$$Injection$$Activator,GzipEncodingProvider,JacksonMediaSupportProvider,JsonbMediaSupportProvider,JsonpMediaSupportProvider,LoomClient$$Injection$$Activator,ObserveFeature,OciAuthenticationDetailsProvider$$Injection$$Activator,OciAvailabilityDefault$$Injection$$Activator,OciRegionProvider$$Injection$$Activator,RetryImpl$$Injection$$Activator,SecurityHttpFeature,TimeoutImpl$$Injection$$Activator
Interface to define that this class is a class with weight.
One of the uses is for services loaded by a ServiceLoader.
A Weighted with higher weight is more significant than a Weighted with a
lower weight.
For cases where weight is the same, implementation must define ordering of such Weighted.
Negative weights are not allowed and services using weight should throw an
IllegalArgumentException if such a weight is used (unless such a service
documents the specific usage of a negative weight)
A Weighted with weight 2 is more significant (will be returned before) weight 1.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault weight for any weighted component (whether it implements this interface or usesWeightannotation). -
Method Summary
-
Field Details
-
DEFAULT_WEIGHT
static final double DEFAULT_WEIGHTDefault weight for any weighted component (whether it implements this interface or usesWeightannotation).- See Also:
-
-
Method Details
-
weight
default double weight()Weight of this class (maybe because it is defined dynamically, so it cannot be defined by an annotation). If not dynamic, you can use theWeightannotation rather than implementing this interface as long as it is supported by the library using thisWeighted.- Returns:
- the weight of this service, must be a non-negative number
-
compareTo
- Specified by:
compareToin interfaceComparable<Weighted>
-