Package com.io7m.changelog.core
Class CChange.Builder
java.lang.Object
com.io7m.changelog.core.CChange.Builder
- Enclosing class:
- CChange
public static final class CChange.Builder
extends java.lang.Object
-
Method Summary
Modifier and Type Method Description CChange.BuilderaddAllTickets(java.lang.Iterable<? extends CTicketID> elements)Adds elements toticketslist.CChange.BuilderaddTickets(CTicketID element)Adds one element toticketslist.CChange.BuilderaddTickets(CTicketID... elements)Adds elements toticketslist.CChangebuild()Builds a newCChange.CChange.Builderfrom(CChangeType instance)Fill a builder with attribute values from the providedCChangeTypeinstance.CChange.BuildersetBackwardsCompatible(boolean backwardsCompatible)Initializes the value for thebackwardsCompatibleattribute.CChange.BuildersetDate(java.time.ZonedDateTime date)Initializes the value for thedateattribute.CChange.BuildersetModule(CModuleName module)Initializes the optional valuemoduleto module.CChange.BuildersetModule(java.util.Optional<? extends CModuleName> module)Initializes the optional valuemoduleto module.CChange.BuildersetSummary(java.lang.String summary)Initializes the value for thesummaryattribute.CChange.BuildersetTickets(java.lang.Iterable<? extends CTicketID> elements)Sets or replaces all elements forticketslist.
-
Method Details
-
from
Fill a builder with attribute values from the providedCChangeTypeinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
setDate
Initializes the value for thedateattribute.- Parameters:
date- The value for date- Returns:
thisbuilder for use in a chained invocation
-
setSummary
Initializes the value for thesummaryattribute.- Parameters:
summary- The value for summary- Returns:
thisbuilder for use in a chained invocation
-
addTickets
Adds one element toticketslist.- Parameters:
element- A tickets element- Returns:
thisbuilder for use in a chained invocation
-
addTickets
Adds elements toticketslist.- Parameters:
elements- An array of tickets elements- Returns:
thisbuilder for use in a chained invocation
-
setTickets
Sets or replaces all elements forticketslist.- Parameters:
elements- An iterable of tickets elements- Returns:
thisbuilder for use in a chained invocation
-
addAllTickets
Adds elements toticketslist.- Parameters:
elements- An iterable of tickets elements- Returns:
thisbuilder for use in a chained invocation
-
setModule
Initializes the optional valuemoduleto module.- Parameters:
module- The value for module- Returns:
thisbuilder for chained invocation
-
setModule
Initializes the optional valuemoduleto module.- Parameters:
module- The value for module- Returns:
thisbuilder for use in a chained invocation
-
setBackwardsCompatible
Initializes the value for thebackwardsCompatibleattribute.If not set, this attribute will have a default value as returned by the initializer of
backwardsCompatible.- Parameters:
backwardsCompatible- The value for backwardsCompatible- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newCChange.- Returns:
- An immutable instance of CChange
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-