Class InfoPropertiesInfoContributor<T extends InfoProperties>
java.lang.Object
org.springframework.boot.actuate.info.InfoPropertiesInfoContributor<T>
- Type Parameters:
T- the type of theInfoPropertiesto expose
- All Implemented Interfaces:
InfoContributor
- Direct Known Subclasses:
BuildInfoContributor, GitInfoContributor
public abstract class InfoPropertiesInfoContributor<T extends InfoProperties>
extends Object
implements InfoContributor
A base
InfoContributor to expose an InfoProperties.- Since:
- 1.4.0
- Author:
- Stephane Nicoll, Madhura Bhave
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines how properties should be exposed. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedInfoPropertiesInfoContributor(T properties, InfoPropertiesInfoContributor.Mode mode) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcopyIfSet(Properties target, String key) Copy the specified key to the targetPropertiesif it is set.extractContent(PropertySource<?> propertySource) Extract the raw content based on the specifiedPropertySource.Extract the content to contribute to the info endpoint.protected final InfoPropertiesInfoContributor.ModegetMode()Return the mode that should be used to expose the content.getNestedMap(Map<String, Object> map, String key) Return the nested map with the specified key or empty map if the specified map contains no mapping for the key.protected final TReturn the properties that this instance manages.protected voidpostProcessContent(Map<String, Object> content) Post-process the content to expose.protected voidReplace thevaluefor the specified key if the value is notnull.protected PropertySource<?> Return thePropertySourceto use based on the chosenInfoPropertiesInfoContributor.Mode.protected abstract PropertySource<?> Return aPropertySourcefor theSIMPLEmode.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface InfoContributor
contribute
-
Constructor Details
-
InfoPropertiesInfoContributor
-
-
Method Details
-
getProperties
Return the properties that this instance manages.- Returns:
- the info properties
-
getMode
Return the mode that should be used to expose the content.- Returns:
- the mode
-
toSimplePropertySource
Return aPropertySourcefor theSIMPLEmode.- Returns:
- the property source for the simple model
- See Also:
-
generateContent
-
extractContent
Extract the raw content based on the specifiedPropertySource.- Parameters:
propertySource- the property source to use- Returns:
- the raw content
-
postProcessContent
-
toPropertySource
Return thePropertySourceto use based on the chosenInfoPropertiesInfoContributor.Mode.- Returns:
- the property source
-
copyIfSet
Copy the specified key to the targetPropertiesif it is set.- Parameters:
target- the target properties to updatekey- the key
-
replaceValue
-
getNestedMap
-