Interface PresentProvider<T>
- Type Parameters:
T- Type of value represented by the provider
- All Superinterfaces:
Provider<T>
A
Provider that is always present, that is, one that always has a value.
Querying the value of this provider never fails: get() always returns the value,
getOrNull() never returns null and isPresent() always returns true.
Only the presence of the value is guaranteed; the value itself is not necessarily constant.
Note: This interface is not intended for implementation by build script or plugin authors.
A provider that is always present can be created via ProviderFactory.present(Object).
- Since:
- 9.9.0
-
Method Summary
Modifier and TypeMethodDescriptionget()Returns the value of this provider.Returns the value of this provider.Returns the value of this provider.booleanReturns whether the provider has a value present.Returns this provider, as the value is always present and the given default provider can never be used.Returns this provider, as the value is always present and the given default value can never be used.
-
Method Details
-
get
T get()Returns the value of this provider. UnlikeProvider.get(), never fails, as the value is always present. -
getOrNull
T getOrNull()Returns the value of this provider. UnlikeProvider.getOrNull(), never returnsnull, as the value is always present. -
getOrElse
Returns the value of this provider. UnlikeProvider.getOrElse(Object), the given default value is never used, as the value is always present. -
isPresent
-
orElse
Returns this provider, as the value is always present and the given default value can never be used. -
orElse
Returns this provider, as the value is always present and the given default provider can never be used.
-