Class CChangelog

java.lang.Object
com.io7m.changelog.core.CChangelog
All Implemented Interfaces:
CChangelogType

public final class CChangelog
extends java.lang.Object
implements CChangelogType
The type of changelogs.
  • Method Details

    • project

      public CProjectName project()
      Specified by:
      project in interface CChangelogType
      Returns:
      The project name
    • releases

      public java.util.Map<CVersion,​CRelease> releases()
      Specified by:
      releases in interface CChangelogType
      Returns:
      The list of releases
    • ticketSystems

      public java.util.Map<java.lang.String,​CTicketSystem> ticketSystems()
      Specified by:
      ticketSystems in interface CChangelogType
      Returns:
      The ticket systems
    • withProject

      public final CChangelog withProject​(CProjectName value)
      Copy the current immutable object by setting a value for the project attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for project
      Returns:
      A modified copy of the this object
    • withReleases

      public final CChangelog withReleases​(java.util.Map<? extends CVersion,​? extends CRelease> entries)
      Copy the current immutable object by replacing the releases map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the releases map
      Returns:
      A modified copy of this object
    • withTicketSystems

      public final CChangelog withTicketSystems​(java.util.Map<java.lang.String,​? extends CTicketSystem> entries)
      Copy the current immutable object by replacing the ticketSystems map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the ticketSystems map
      Returns:
      A modified copy of this object
    • equals

      public boolean equals​(java.lang.Object another)
      This instance is equal to all instances of CChangelog that have equal attribute values.
      Overrides:
      equals in class java.lang.Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: project, releases, ticketSystems.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

      public java.lang.String toString()
      Prints the immutable value CChangelog with attribute values.
      Overrides:
      toString in class java.lang.Object
      Returns:
      A string representation of the value
    • copyOf

      public static CChangelog copyOf​(CChangelogType instance)
      Creates an immutable copy of a CChangelogType value. 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 CChangelog instance
    • builder

      public static CChangelog.Builder builder()
      Creates a builder for CChangelog.
       CChangelog.builder()
          .setProject(com.io7m.changelog.core.CProjectName) // required project
          .putReleases|putAllReleases(CVersion => CRelease) // releases mappings
          .putTicketSystems|putAllTicketSystems(String => CTicketSystem) // ticketSystems mappings
          .build();
       
      Returns:
      A new CChangelog builder