Package com.io7m.changelog.core
Class CChangelog.Builder
java.lang.Object
com.io7m.changelog.core.CChangelog.Builder
- Enclosing class:
- CChangelog
public static final class CChangelog.Builder
extends java.lang.Object
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 Type Method Description CChangelogbuild()Builds a newCChangelog.CChangelog.Builderfrom(CChangelogType instance)Fill a builder with attribute values from the providedCChangelogTypeinstance.CChangelog.BuilderputAllReleases(java.util.Map<? extends CVersion,? extends CRelease> entries)Put all mappings from the specified map as entries toreleasesmap.CChangelog.BuilderputAllTicketSystems(java.util.Map<java.lang.String,? extends CTicketSystem> entries)Put all mappings from the specified map as entries toticketSystemsmap.CChangelog.BuilderputReleases(CVersion key, CRelease value)Put one entry to thereleasesmap.CChangelog.BuilderputReleases(java.util.Map.Entry<? extends CVersion,? extends CRelease> entry)Put one entry to thereleasesmap.CChangelog.BuilderputTicketSystems(java.lang.String key, CTicketSystem value)Put one entry to theticketSystemsmap.CChangelog.BuilderputTicketSystems(java.util.Map.Entry<java.lang.String,? extends CTicketSystem> entry)Put one entry to theticketSystemsmap.CChangelog.BuildersetProject(CProjectName project)Initializes the value for theprojectattribute.CChangelog.BuildersetReleases(java.util.Map<? extends CVersion,? extends CRelease> entries)Sets or replaces all mappings from the specified map as entries for thereleasesmap.CChangelog.BuildersetTicketSystems(java.util.Map<java.lang.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
-
putReleases
Put one entry to thereleasesmap.- Parameters:
key- The key in the releases mapvalue- The associated value in the releases map- Returns:
thisbuilder for use in a chained invocation
-
putReleases
public final CChangelog.Builder putReleases(java.util.Map.Entry<? extends CVersion,? extends CRelease> entry)Put one entry to thereleasesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
setReleases
public final CChangelog.Builder setReleases(java.util.Map<? extends CVersion,? extends CRelease> entries)Sets or replaces all mappings from the specified map as entries for thereleasesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the releases map- Returns:
thisbuilder for use in a chained invocation
-
putAllReleases
public final CChangelog.Builder putAllReleases(java.util.Map<? extends CVersion,? extends CRelease> entries)Put all mappings from the specified map as entries toreleasesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the releases map- 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
public final CChangelog.Builder putTicketSystems(java.util.Map.Entry<java.lang.String,? extends CTicketSystem> entry)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
public final CChangelog.Builder setTicketSystems(java.util.Map<java.lang.String,? extends CTicketSystem> entries)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
public final CChangelog.Builder putAllTicketSystems(java.util.Map<java.lang.String,? extends CTicketSystem> entries)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:
java.lang.IllegalStateException- if any required attributes are missing
-