Package com.io7m.changelog.core
Class CChange
java.lang.Object
com.io7m.changelog.core.CChange
- All Implemented Interfaces:
CChangeType
A change within a specific release.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic CChange.Builderbuilder()Creates a builder forCChange.static CChangecopyOf(CChangeType instance) Creates an immutable copy of aCChangeTypevalue.date()booleanThis instance is equal to all instances ofCChangethat have equal attribute values.inthashCode()Computes a hash code from attributes:date,summary,tickets,module,backwardsCompatible.module()summary()tickets()toString()Prints the immutable valueCChangewith attribute values.final CChangewithBackwardsCompatible(boolean value) Copy the current immutable object by setting a value for thebackwardsCompatibleattribute.final CChangewithDate(ZonedDateTime value) Copy the current immutable object by setting a value for thedateattribute.final CChangewithModule(CModuleName value) Copy the current immutable object by setting a present value for the optionalmoduleattribute.final CChangewithModule(Optional<? extends CModuleName> optional) Copy the current immutable object by setting an optional value for themoduleattribute.final CChangewithSummary(String value) Copy the current immutable object by setting a value for thesummaryattribute.final CChangewithTickets(CTicketID... elements) Copy the current immutable object with elements that replace the content oftickets.final CChangewithTickets(Iterable<? extends CTicketID> elements) Copy the current immutable object with elements that replace the content oftickets.
-
Method Details
-
date
- Specified by:
datein interfaceCChangeType- Returns:
- The change date
-
summary
- Specified by:
summaryin interfaceCChangeType- Returns:
- The change summary
-
tickets
- Specified by:
ticketsin interfaceCChangeType- Returns:
- The change tickets
-
module
- Specified by:
modulein interfaceCChangeType- Returns:
- The module that this change affects
-
backwardsCompatible
public boolean backwardsCompatible()- Specified by:
backwardsCompatiblein interfaceCChangeType- Returns:
trueiff the change is backwards compatible
-
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
-
withSummary
Copy the current immutable object by setting a value for thesummaryattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for summary- Returns:
- A modified copy of the
thisobject
-
withTickets
Copy the current immutable object with elements that replace the content oftickets.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withTickets
Copy the current immutable object with elements that replace the content oftickets. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of tickets elements to set- Returns:
- A modified copy of
thisobject
-
withModule
Copy the current immutable object by setting a present value for the optionalmoduleattribute.- Parameters:
value- The value for module- Returns:
- A modified copy of
thisobject
-
withModule
Copy the current immutable object by setting an optional value for themoduleattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for module- Returns:
- A modified copy of
thisobject
-
withBackwardsCompatible
Copy the current immutable object by setting a value for thebackwardsCompatibleattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for backwardsCompatible- Returns:
- A modified copy of the
thisobject
-
equals
This instance is equal to all instances ofCChangethat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:date,summary,tickets,module,backwardsCompatible. -
toString
Prints the immutable valueCChangewith attribute values. -
copyOf
Creates an immutable copy of aCChangeTypevalue. 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 CChange instance
-
builder
Creates a builder forCChange.CChange.builder() .setDate(java.time.ZonedDateTime) // requireddate.setSummary(String) // requiredsummary.addTickets|addAllTickets(CTicketID) //ticketselements .setModule(CModuleName) // optionalmodule.setBackwardsCompatible(boolean) // optionalbackwardsCompatible.build();- Returns:
- A new CChange builder
-