Package com.io7m.changelog.core
Class CRelease
java.lang.Object
com.io7m.changelog.core.CRelease
- All Implemented Interfaces:
CReleaseType
A specific release in a changelog.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic CRelease.Builder
builder()
Creates a builder forCRelease
.changes()
static CRelease
copyOf
(CReleaseType instance) Creates an immutable copy of aCReleaseType
value.date()
boolean
This instance is equal to all instances ofCRelease
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:date
,changes
,ticketSystemID
,version
,open
.boolean
isOpen()
toString()
Prints the immutable valueCRelease
with attribute values.version()
final CRelease
withChanges
(CChange... elements) Copy the current immutable object with elements that replace the content ofchanges
.final CRelease
withChanges
(Iterable<? extends CChange> elements) Copy the current immutable object with elements that replace the content ofchanges
.final CRelease
withDate
(ZonedDateTime value) Copy the current immutable object by setting a value for thedate
attribute.final CRelease
withOpen
(boolean value) Copy the current immutable object by setting a value for theopen
attribute.final CRelease
withTicketSystemID
(String value) Copy the current immutable object by setting a value for theticketSystemID
attribute.final CRelease
withVersion
(CVersion value) Copy the current immutable object by setting a value for theversion
attribute.
-
Method Details
-
date
- Specified by:
date
in interfaceCReleaseType
- Returns:
- The release date
-
changes
- Specified by:
changes
in interfaceCReleaseType
- Returns:
- The list of release changes
-
ticketSystemID
- Specified by:
ticketSystemID
in interfaceCReleaseType
- Returns:
- The ticket system ID
-
version
- Specified by:
version
in interfaceCReleaseType
- Returns:
- The version number
-
isOpen
public boolean isOpen()- Specified by:
isOpen
in interfaceCReleaseType
- Returns:
true
if the release is open for modifications
-
withDate
Copy the current immutable object by setting a value for thedate
attribute. 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
this
object
-
withChanges
Copy the current immutable object with elements that replace the content ofchanges
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
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
this
object
-
withTicketSystemID
Copy the current immutable object by setting a value for theticketSystemID
attribute. 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
this
object
-
withVersion
Copy the current immutable object by setting a value for theversion
attribute. 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
this
object
-
withOpen
Copy the current immutable object by setting a value for theopen
attribute. 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
this
object
-
equals
This instance is equal to all instances ofCRelease
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:date
,changes
,ticketSystemID
,version
,open
. -
toString
Prints the immutable valueCRelease
with attribute values. -
copyOf
Creates an immutable copy of aCReleaseType
value. 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) // required
date
.addChanges|addAllChanges(CChange) //changes
elements .setTicketSystemID(String) // requiredticketSystemID
.setVersion(com.io7m.changelog.core.CVersion) // requiredversion
.setOpen(boolean) // requiredopen
.build();- Returns:
- A new CRelease builder
-