Package com.io7m.changelog.core
Class CChangelog
java.lang.Object
com.io7m.changelog.core.CChangelog
- All Implemented Interfaces:
CChangelogType
public final class CChangelog extends java.lang.Object implements CChangelogType
The type of changelogs.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCChangelog.BuilderBuilds instances of typeCChangelog. -
Method Summary
Modifier and Type Method Description static CChangelog.Builderbuilder()Creates a builder forCChangelog.static CChangelogcopyOf(CChangelogType instance)Creates an immutable copy of aCChangelogTypevalue.booleanequals(java.lang.Object another)This instance is equal to all instances ofCChangelogthat have equal attribute values.inthashCode()Computes a hash code from attributes:project,releases,ticketSystems.CProjectNameproject()java.util.Map<CVersion,CRelease>releases()java.util.Map<java.lang.String,CTicketSystem>ticketSystems()java.lang.StringtoString()Prints the immutable valueCChangelogwith attribute values.CChangelogwithProject(CProjectName value)Copy the current immutable object by setting a value for theprojectattribute.CChangelogwithReleases(java.util.Map<? extends CVersion,? extends CRelease> entries)Copy the current immutable object by replacing thereleasesmap with the specified map.CChangelogwithTicketSystems(java.util.Map<java.lang.String,? extends CTicketSystem> entries)Copy the current immutable object by replacing theticketSystemsmap with the specified map.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.changelog.core.CChangelogType
checkPreconditions, findTargetRelease, findTargetReleaseOrLatest, findTargetReleaseOrLatestOpen, findTicketSystem, latestRelease, releaseVersions, suggestNextRelease
-
Method Details
-
project
- Specified by:
projectin interfaceCChangelogType- Returns:
- The project name
-
releases
- Specified by:
releasesin interfaceCChangelogType- Returns:
- The list of releases
-
ticketSystems
- Specified by:
ticketSystemsin interfaceCChangelogType- Returns:
- The ticket systems
-
withProject
Copy the current immutable object by setting a value for theprojectattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for project- Returns:
- A modified copy of the
thisobject
-
withReleases
public final CChangelog withReleases(java.util.Map<? extends CVersion,? extends CRelease> entries)Copy the current immutable object by replacing thereleasesmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the releases map- Returns:
- A modified copy of
thisobject
-
withTicketSystems
public final CChangelog withTicketSystems(java.util.Map<java.lang.String,? extends CTicketSystem> entries)Copy the current immutable object by replacing theticketSystemsmap with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
entries- The entries to be added to the ticketSystems map- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofCChangelogthat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:project,releases,ticketSystems.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueCChangelogwith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aCChangelogTypevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable CChangelog instance
-
builder
Creates a builder forCChangelog.CChangelog.builder() .setProject(com.io7m.changelog.core.CProjectName) // requiredproject.putReleases|putAllReleases(CVersion => CRelease) //releasesmappings .putTicketSystems|putAllTicketSystems(String => CTicketSystem) //ticketSystemsmappings .build();- Returns:
- A new CChangelog builder
-