org.springframework.boot.info

Class GitProperties

  • All Implemented Interfaces:
    java.lang.Iterable<InfoProperties.Entry>


    public class GitProperties
    extends InfoProperties
    Provide git-related information such as commit id and time.
    Since:
    1.4.0
    • Constructor Summary

      Constructors 
      Constructor and Description
      GitProperties(java.util.Properties entries) 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.String getBranch()
      Return the name of the branch or null.
      java.lang.String getCommitId()
      Return the full id of the commit or null.
      java.time.Instant getCommitTime()
      Return the timestamp of the commit or null.
      java.lang.String getShortCommitId()
      Return the abbreviated id of the commit or null.
      • 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

      • GitProperties

        public GitProperties(java.util.Properties entries)
    • Method Detail

      • getBranch

        public java.lang.String getBranch()
        Return the name of the branch or null.
        Returns:
        the branch
      • getCommitId

        public java.lang.String getCommitId()
        Return the full id of the commit or null.
        Returns:
        the full commit id
      • getShortCommitId

        public java.lang.String getShortCommitId()
        Return the abbreviated id of the commit or null.
        Returns:
        the short commit id
      • getCommitTime

        public java.time.Instant getCommitTime()
        Return the timestamp of the commit or null.

        If the original value could not be parsed properly, it is still available with the commit.time key.

        Returns:
        the commit time
        See Also:
        InfoProperties.get(String)