- java.lang.Object
-
- com.io7m.changelog.core.CChange
-
- All Implemented Interfaces:
CChangeType
public final class CChange extends 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbackwardsCompatible()static CChange.Builderbuilder()Creates a builder forCChange.static CChangecopyOf(CChangeType instance)Creates an immutable copy of aCChangeTypevalue.ZonedDateTimedate()booleanequals(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.Optional<CModuleName>module()static CChangeof(ZonedDateTime date, String summary, io.vavr.collection.List<CTicketID> tickets, Optional<? extends CModuleName> module, boolean backwardsCompatible)Construct a new immutableCChangeinstance.Stringsummary()io.vavr.collection.List<CTicketID>tickets()StringtoString()Prints the immutable valueCChangewith attribute values.CChangewithBackwardsCompatible(boolean value)Copy the current immutable object by setting a value for thebackwardsCompatibleattribute.CChangewithDate(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(Optional<? extends CModuleName> optional)Copy the current immutable object by setting an optional value for themoduleattribute.CChangewithSummary(String value)Copy the current immutable object by setting a value for thesummaryattribute.CChangewithTickets(io.vavr.collection.List<CTicketID> value)
-
-
-
Method Detail
-
date
public ZonedDateTime date()
- Specified by:
datein interfaceCChangeType- Returns:
- The change date
-
summary
public String summary()
- Specified by:
summaryin interfaceCChangeType- Returns:
- The change summary
-
tickets
public io.vavr.collection.List<CTicketID> tickets()
- Specified by:
ticketsin interfaceCChangeType- Returns:
- The change tickets
-
module
public Optional<CModuleName> 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
public final CChange 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
-
withSummary
public final CChange withSummary(String value)
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
-
withModule
public final CChange withModule(CModuleName value)
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
public final CChange withModule(Optional<? extends CModuleName> optional)
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
public final CChange withBackwardsCompatible(boolean value)
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(Object another)
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
public String toString()
Prints the immutable valueCChangewith attribute values.
-
of
public static CChange of(ZonedDateTime date, String summary, io.vavr.collection.List<CTicketID> tickets, Optional<? extends CModuleName> module, boolean backwardsCompatible)
Construct a new immutableCChangeinstance.- Parameters:
date- The value for thedateattributesummary- The value for thesummaryattributetickets- The value for theticketsattributemodule- The value for themoduleattributebackwardsCompatible- The value for thebackwardsCompatibleattribute- Returns:
- An immutable CChange instance
-
copyOf
public static CChange copyOf(CChangeType instance)
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
public static CChange.Builder builder()
Creates a builder forCChange.- Returns:
- A new CChange builder
-
-