Class DefaultHealthContributorRegistry
java.lang.Object
org.springframework.boot.health.registry.DefaultHealthContributorRegistry
- All Implemented Interfaces:
Iterable<HealthContributors.Entry>, HealthContributors, HealthContributorRegistry
Default
HealthContributorRegistry implementation.- Since:
- 4.0.0
- Author:
- Phillip Webb
-
Nested Class Summary
Nested classes/interfaces inherited from interface HealthContributors
HealthContributors.Entry -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new emptyDefaultHealthContributorRegistryinstance.DefaultHealthContributorRegistry(@Nullable Collection<? extends HealthContributorNameValidator> nameValidators, @Nullable Consumer<BiConsumer<String, HealthContributor>> initialRegistrations) Create a newDefaultHealthContributorRegistryinstance. -
Method Summary
Modifier and TypeMethodDescription@Nullable HealthContributorgetContributor(String name) Return the contributor with the given name.voidregisterContributor(String name, HealthContributor contributor) Register a contributor with the givenname.stream()Return a stream of the contributor entries.@Nullable HealthContributorunregisterContributor(String name) Unregister a previously registered contributor.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HealthContributors
iteratorMethods inherited from interface Iterable
forEach, spliterator
-
Constructor Details
-
DefaultHealthContributorRegistry
public DefaultHealthContributorRegistry()Create a new emptyDefaultHealthContributorRegistryinstance. -
DefaultHealthContributorRegistry
public DefaultHealthContributorRegistry(@Nullable Collection<? extends HealthContributorNameValidator> nameValidators, @Nullable Consumer<BiConsumer<String, HealthContributor>> initialRegistrations) Create a newDefaultHealthContributorRegistryinstance.- Parameters:
nameValidators- the name validators to applyinitialRegistrations- callback to setup any initial registrations
-
-
Method Details
-
getContributor
Description copied from interface:HealthContributorsReturn the contributor with the given name.- Specified by:
getContributorin interfaceHealthContributors- Parameters:
name- the name of the contributor- Returns:
- a contributor instance or
null
-
stream
Description copied from interface:HealthContributorsReturn a stream of the contributor entries.- Specified by:
streamin interfaceHealthContributors- Returns:
- the stream of named contributors
-
registerContributor
Description copied from interface:HealthContributorRegistryRegister a contributor with the givenname.- Specified by:
registerContributorin interfaceHealthContributorRegistry- Parameters:
name- the name of the contributorcontributor- the contributor to register
-
unregisterContributor
Description copied from interface:HealthContributorRegistryUnregister a previously registered contributor.- Specified by:
unregisterContributorin interfaceHealthContributorRegistry- Parameters:
name- the name of the contributor to unregister- Returns:
- the unregistered indicator, or
nullif no indicator was found in the registry for the givenname.
-