Package com.io7m.changelog.core
Class CChange
java.lang.Object
com.io7m.changelog.core.CChange
- All Implemented Interfaces:
CChangeType
public final class CChange extends java.lang.Object implements CChangeType
A change within a specific release.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCChange.BuilderBuilds instances of typeCChange. -
Method Summary
Modifier and Type Method Description booleanbackwardsCompatible()static CChange.Builderbuilder()Creates a builder forCChange.static CChangecopyOf(CChangeType instance)Creates an immutable copy of aCChangeTypevalue.java.time.ZonedDateTimedate()booleanequals(java.lang.Object another)This instance is equal to all instances ofCChangethat have equal attribute values.inthashCode()Computes a hash code from attributes:date,summary,tickets,module,backwardsCompatible.java.util.Optional<CModuleName>module()java.lang.Stringsummary()java.util.List<CTicketID>tickets()java.lang.StringtoString()Prints the immutable valueCChangewith attribute values.CChangewithBackwardsCompatible(boolean value)Copy the current immutable object by setting a value for thebackwardsCompatibleattribute.CChangewithDate(java.time.ZonedDateTime value)Copy the current immutable object by setting a value for thedateattribute.CChangewithModule(CModuleName value)Copy the current immutable object by setting a present value for the optionalmoduleattribute.CChangewithModule(java.util.Optional<? extends CModuleName> optional)Copy the current immutable object by setting an optional value for themoduleattribute.CChangewithSummary(java.lang.String value)Copy the current immutable object by setting a value for thesummaryattribute.CChangewithTickets(CTicketID... elements)Copy the current immutable object with elements that replace the content oftickets.CChangewithTickets(java.lang.Iterable<? extends CTicketID> elements)Copy the current immutable object with elements that replace the content oftickets.
-
Method Details
-
date
public java.time.ZonedDateTime date()- Specified by:
datein interfaceCChangeType- Returns:
- The change date
-
summary
public java.lang.String 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
public boolean equals(java.lang.Object another)This instance is equal to all instances ofCChangethat have equal attribute values.- Overrides:
equalsin classjava.lang.Object- Returns:
trueifthisis equal toanotherinstance
-
hashCode
public int hashCode()Computes a hash code from attributes:date,summary,tickets,module,backwardsCompatible.- Overrides:
hashCodein classjava.lang.Object- Returns:
- hashCode value
-
toString
public java.lang.String toString()Prints the immutable valueCChangewith attribute values.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the value
-
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
-