public class Changelog extends Object
Partitions a string into its changelog headers and the release notes under each header.
Capable of round-tripping - if you change the strings inside ParsedChangelog, you can write out a new changelog with new content, while preserving all formatting and non-changelog content in the string.
Modifier and Type | Class and Description |
---|---|
static class |
Changelog.VersionEntry
Contains everything about a single entry in the changelog list.
|
Constructor and Description |
---|
Changelog(String contentRaw)
Takes a changelog string as its argument.
|
Modifier and Type | Method and Description |
---|---|
LinkedHashMap<Integer,String> |
errors()
Map from line number to the error message, in the order they were encountered.
|
boolean |
noUnreleasedChanges()
Returns true if there are no unreleased changes.
|
Changelog |
releaseUnreleased(String version,
String date)
Returns a new changelog where the [Unreleased] section has been released with the given version and date.
|
String |
toString()
Returns the full content of this changelog as a string, with the same newlines as the input string.
|
String |
toStringUnix()
Returns the full content of this changelog as a string unix-newlines.
|
String |
unreleasedChanges()
Returns the string describing unreleased changes - starts with a newline, and has unix newlines.
|
@NullOr String |
versionLast()
Returns the most recently published version, if any.
|
public Changelog(String contentRaw)
Takes a changelog string as its argument.
public String toStringUnix()
Returns the full content of this changelog as a string unix-newlines.
public String toString()
Returns the full content of this changelog as a string, with the same newlines as the input string.
public @NullOr String versionLast()
Returns the most recently published version, if any.
public String unreleasedChanges()
Returns the string describing unreleased changes - starts with a newline, and has unix newlines.
public boolean noUnreleasedChanges()
Returns true if there are no unreleased changes.
public LinkedHashMap<Integer,String> errors()
Map from line number to the error message, in the order they were encountered.