Package com.io7m.changelog.core
Class CRelease
java.lang.Object
com.io7m.changelog.core.CRelease
- All Implemented Interfaces:
CReleaseType
public final class CRelease extends java.lang.Object implements CReleaseType
A specific release in a changelog.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCRelease.BuilderBuilds instances of typeCRelease. -
Method Summary
Modifier and Type Method Description static CRelease.Builderbuilder()Creates a builder forCRelease.java.util.List<CChange>changes()static CReleasecopyOf(CReleaseType instance)Creates an immutable copy of aCReleaseTypevalue.java.time.ZonedDateTimedate()booleanequals(java.lang.Object another)This instance is equal to all instances ofCReleasethat have equal attribute values.inthashCode()Computes a hash code from attributes:date,changes,ticketSystemID,version,open.booleanisOpen()java.lang.StringticketSystemID()java.lang.StringtoString()Prints the immutable valueCReleasewith attribute values.CVersionversion()CReleasewithChanges(CChange... elements)Copy the current immutable object with elements that replace the content ofchanges.CReleasewithChanges(java.lang.Iterable<? extends CChange> elements)Copy the current immutable object with elements that replace the content ofchanges.CReleasewithDate(java.time.ZonedDateTime value)Copy the current immutable object by setting a value for thedateattribute.CReleasewithOpen(boolean value)Copy the current immutable object by setting a value for theopenattribute.CReleasewithTicketSystemID(java.lang.String value)Copy the current immutable object by setting a value for theticketSystemIDattribute.CReleasewithVersion(CVersion value)Copy the current immutable object by setting a value for theversionattribute.
-
Method Details
-
date
public java.time.ZonedDateTime date()- Specified by:
datein interfaceCReleaseType- Returns:
- The release date
-
changes
- Specified by:
changesin interfaceCReleaseType- Returns:
- The list of release changes
-
ticketSystemID
public java.lang.String ticketSystemID()- Specified by:
ticketSystemIDin interfaceCReleaseType- Returns:
- The ticket system ID
-
version
- Specified by:
versionin interfaceCReleaseType- Returns:
- The version number
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceCReleaseType- Returns:
trueif the release is open for modifications
-
withDate
Copy the current immutable object by setting a value for thedateattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for date- Returns:
- A modified copy of the
thisobject
-
withChanges
Copy the current immutable object with elements that replace the content ofchanges.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withChanges
Copy the current immutable object with elements that replace the content ofchanges. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of changes elements to set- Returns:
- A modified copy of
thisobject
-
withTicketSystemID
Copy the current immutable object by setting a value for theticketSystemIDattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ticketSystemID- Returns:
- A modified copy of the
thisobject
-
withVersion
Copy the current immutable object by setting a value for theversionattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for version- Returns:
- A modified copy of the
thisobject
-
withOpen
Copy the current immutable object by setting a value for theopenattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for open- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(java.lang.Object another)This instance is equal to all instances ofCReleasethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:date,changes,ticketSystemID,version,open.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueCReleasewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
copyOf
Creates an immutable copy of aCReleaseTypevalue. 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 CRelease instance
-
builder
Creates a builder forCRelease.CRelease.builder() .setDate(java.time.ZonedDateTime) // requireddate.addChanges|addAllChanges(CChange) //changeselements .setTicketSystemID(String) // requiredticketSystemID.setVersion(com.io7m.changelog.core.CVersion) // requiredversion.setOpen(boolean) // requiredopen.build();- Returns:
- A new CRelease builder
-