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 Details

    • from

      public final CChangelog.Builder from​(CChangelogType instance)
      Fill a builder with attribute values from the provided CChangelogType instance. 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:
      this builder for use in a chained invocation
    • setProject

      public final CChangelog.Builder setProject​(CProjectName project)
      Initializes the value for the project attribute.
      Parameters:
      project - The value for project
      Returns:
      this builder for use in a chained invocation
    • putReleases

      public final CChangelog.Builder putReleases​(CVersion key, CRelease value)
      Put one entry to the releases map.
      Parameters:
      key - The key in the releases map
      value - The associated value in the releases map
      Returns:
      this builder 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 the releases map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder 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 the releases map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the releases map
      Returns:
      this builder 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 to releases map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the releases map
      Returns:
      this builder for use in a chained invocation
    • putTicketSystems

      public final CChangelog.Builder putTicketSystems​(java.lang.String key, CTicketSystem value)
      Put one entry to the ticketSystems map.
      Parameters:
      key - The key in the ticketSystems map
      value - The associated value in the ticketSystems map
      Returns:
      this builder 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 the ticketSystems map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder 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 the ticketSystems map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the ticketSystems map
      Returns:
      this builder 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 to ticketSystems map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the ticketSystems map
      Returns:
      this builder for use in a chained invocation
    • build

      public CChangelog build()
      Builds a new CChangelog.
      Returns:
      An immutable instance of CChangelog
      Throws:
      java.lang.IllegalStateException - if any required attributes are missing