org.springframework.boot.info

Class InfoProperties

  • java.lang.Object
    • org.springframework.boot.info.InfoProperties
  • All Implemented Interfaces:
    java.lang.Iterable<InfoProperties.Entry>
    Direct Known Subclasses:
    BuildProperties, GitProperties


    public class InfoProperties
    extends java.lang.Object
    implements java.lang.Iterable<InfoProperties.Entry>
    Base class for components exposing unstructured data with dedicated methods for well known keys.
    Since:
    1.4.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class and Description
      static class  InfoProperties.Entry
      Property entry.
    • Constructor Summary

      Constructors 
      Constructor and Description
      InfoProperties(java.util.Properties entries)
      Create an instance with the specified entries.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String get(java.lang.String key)
      Return the value of the specified property or null.
      java.time.Instant getInstant(java.lang.String key)
      Return the value of the specified property as an Instant or null if the value is not a valid Long representation of an epoch time.
      java.util.Iterator<InfoProperties.Entry> iterator() 
      org.springframework.core.env.PropertySource<?> toPropertySource()
      Return a PropertySource 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 Detail

      • InfoProperties

        public InfoProperties(java.util.Properties entries)
        Create an instance with the specified entries.
        Parameters:
        entries - the information to expose
    • Method Detail

      • get

        public java.lang.String get(java.lang.String key)
        Return the value of the specified property or null.
        Parameters:
        key - the key of the property
        Returns:
        the property value
      • getInstant

        public java.time.Instant getInstant(java.lang.String key)
        Return the value of the specified property as an Instant or null if the value is not a valid Long representation of an epoch time.
        Parameters:
        key - the key of the property
        Returns:
        the property value
      • toPropertySource

        public org.springframework.core.env.PropertySource<?> toPropertySource()
        Return a PropertySource of this instance.
        Returns:
        a PropertySource