Package org.springframework.boot.info
Class InfoProperties
java.lang.Object
org.springframework.boot.info.InfoProperties
- All Implemented Interfaces:
Iterable<InfoProperties.Entry>
- Direct Known Subclasses:
BuildProperties
,GitProperties
Base class for components exposing unstructured data with dedicated methods for well
known keys.
- Since:
- 1.4.0
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionInfoProperties
(Properties entries) Create an instance with the specified entries. -
Method Summary
Modifier and TypeMethodDescriptionReturn the value of the specified property ornull
.getInstant
(String key) iterator()
org.springframework.core.env.PropertySource<?>
Return aPropertySource
of this instance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
InfoProperties
Create an instance with the specified entries.- Parameters:
entries
- the information to expose
-
-
Method Details
-
get
Return the value of the specified property ornull
.- Parameters:
key
- the key of the property- Returns:
- the property value
-
getInstant
Return the value of the specified property as anInstant
ornull
if the value is not a validLong
representation of an epoch time.- Parameters:
key
- the key of the property- Returns:
- the property value
-
iterator
- Specified by:
iterator
in interfaceIterable<InfoProperties.Entry>
-
toPropertySource
public org.springframework.core.env.PropertySource<?> toPropertySource()Return aPropertySource
of this instance.- Returns:
- a
PropertySource
-