- java.lang.Object
-
- com.io7m.changelog.core.CRelease
-
- All Implemented Interfaces:
CReleaseType
public final class CRelease extends 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CRelease.Builderbuilder()Creates a builder forCRelease.io.vavr.collection.List<CChange>changes()static CReleasecopyOf(CReleaseType instance)Creates an immutable copy of aCReleaseTypevalue.ZonedDateTimedate()booleanequals(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.static CReleaseof(ZonedDateTime date, io.vavr.collection.List<CChange> changes, String ticketSystemID, CVersionType version)Construct a new immutableCReleaseinstance.StringticketSystemID()StringtoString()Prints the immutable valueCReleasewith attribute values.CVersionTypeversion()CReleasewithChanges(io.vavr.collection.List<CChange> value)CReleasewithDate(ZonedDateTime value)Copy the current immutable object by setting a value for thedateattribute.CReleasewithTicketSystemID(String value)Copy the current immutable object by setting a value for theticketSystemIDattribute.CReleasewithVersion(CVersionType value)Copy the current immutable object by setting a value for theversionattribute.
-
-
-
Method Detail
-
date
public ZonedDateTime date()
- Specified by:
datein interfaceCReleaseType- Returns:
- The release date
-
changes
public io.vavr.collection.List<CChange> changes()
- Specified by:
changesin interfaceCReleaseType- Returns:
- The list of release changes
-
ticketSystemID
public String ticketSystemID()
- Specified by:
ticketSystemIDin interfaceCReleaseType- Returns:
- The ticket system ID
-
version
public CVersionType version()
- Specified by:
versionin interfaceCReleaseType- Returns:
- The version number
-
withDate
public final CRelease withDate(ZonedDateTime value)
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
-
withTicketSystemID
public final CRelease withTicketSystemID(String value)
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
public final CRelease withVersion(CVersionType value)
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
-
equals
public boolean equals(Object another)
This instance is equal to all instances ofCReleasethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:date,changes,ticketSystemID,version.
-
toString
public String toString()
Prints the immutable valueCReleasewith attribute values.
-
of
public static CRelease of(ZonedDateTime date, io.vavr.collection.List<CChange> changes, String ticketSystemID, CVersionType version)
Construct a new immutableCReleaseinstance.- Parameters:
date- The value for thedateattributechanges- The value for thechangesattributeticketSystemID- The value for theticketSystemIDattributeversion- The value for theversionattribute- Returns:
- An immutable CRelease instance
-
copyOf
public static CRelease copyOf(CReleaseType instance)
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
public static CRelease.Builder builder()
Creates a builder forCRelease.- Returns:
- A new CRelease builder
-
-