Package org.springframework.boot.info
Class GitProperties
- java.lang.Object
- org.springframework.boot.info.InfoProperties
- org.springframework.boot.info.GitProperties
- All Implemented Interfaces:
Iterable<InfoProperties.Entry>
public class GitProperties extends InfoProperties
Provide git-related information such as commit id and time.- Since:
- 1.4.0
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.boot.info.InfoProperties
InfoProperties.Entry
Constructor Summary
Constructors Constructor Description GitProperties(Properties entries)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBranch()
Return the name of the branch ornull
.String
getCommitId()
Return the full id of the commit ornull
.Instant
getCommitTime()
Return the timestamp of the commit ornull
.String
getShortCommitId()
Return the abbreviated id of the commit ornull
.Methods inherited from class org.springframework.boot.info.InfoProperties
get, getInstant, iterator, toPropertySource
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(Properties entries)
Method Detail
getCommitId
public String getCommitId()
Return the full id of the commit ornull
.- Returns:
- the full commit id
getShortCommitId
public String getShortCommitId()
Return the abbreviated id of the commit ornull
.- Returns:
- the short commit id
getCommitTime
public Instant getCommitTime()
Return the timestamp of the commit ornull
.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)