Package com.io7m.changelog.core
Class CChangelog.Builder
java.lang.Object
com.io7m.changelog.core.CChangelog.Builder
- Enclosing class:
CChangelog
Builds instances of type
CChangelog.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newCChangelog.final CChangelog.Builderfrom(CChangelogType instance) Fill a builder with attribute values from the providedCChangelogTypeinstance.final CChangelog.BuilderputAllTicketSystems(Map<String, ? extends CTicketSystem> entries) Put all mappings from the specified map as entries toticketSystemsmap.final CChangelog.BuilderputTicketSystems(String key, CTicketSystem value) Put one entry to theticketSystemsmap.final CChangelog.BuilderputTicketSystems(Map.Entry<String, ? extends CTicketSystem> entry) Put one entry to theticketSystemsmap.final CChangelog.BuildersetProject(CProjectName project) Initializes the value for theprojectattribute.final CChangelog.BuildersetReleases(SortedMap<CVersion, CRelease> releases) Initializes the value for thereleasesattribute.final CChangelog.BuildersetTicketSystems(Map<String, ? extends CTicketSystem> entries) Sets or replaces all mappings from the specified map as entries for theticketSystemsmap.
-
Method Details
-
from
Fill a builder with attribute values from the providedCChangelogTypeinstance. 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
-
setProject
Initializes the value for theprojectattribute.- Parameters:
project- The value for project- Returns:
thisbuilder for use in a chained invocation
-
setReleases
Initializes the value for thereleasesattribute.If not set, this attribute will have a default value as returned by the initializer of
releases.- Parameters:
releases- The value for releases- Returns:
thisbuilder for use in a chained invocation
-
putTicketSystems
Put one entry to theticketSystemsmap.- Parameters:
key- The key in the ticketSystems mapvalue- The associated value in the ticketSystems map- Returns:
thisbuilder for use in a chained invocation
-
putTicketSystems
Put one entry to theticketSystemsmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
setTicketSystems
Sets or replaces all mappings from the specified map as entries for theticketSystemsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the ticketSystems map- Returns:
thisbuilder for use in a chained invocation
-
putAllTicketSystems
Put all mappings from the specified map as entries toticketSystemsmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the ticketSystems map- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newCChangelog.- Returns:
- An immutable instance of CChangelog
- Throws:
IllegalStateException- if any required attributes are missing
-