Class CRelease

java.lang.Object
com.io7m.changelog.core.CRelease
All Implemented Interfaces:
CReleaseType

public final class CRelease extends Object implements CReleaseType
A specific release in a changelog.
  • Method Details

    • date

      public ZonedDateTime date()
      Specified by:
      date in interface CReleaseType
      Returns:
      The release date
    • changes

      public List<CChange> changes()
      Specified by:
      changes in interface CReleaseType
      Returns:
      The list of release changes
    • ticketSystemID

      public String ticketSystemID()
      Specified by:
      ticketSystemID in interface CReleaseType
      Returns:
      The ticket system ID
    • version

      public CVersion version()
      Specified by:
      version in interface CReleaseType
      Returns:
      The version number
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface CReleaseType
      Returns:
      true if the release is open for modifications
    • withDate

      public final CRelease withDate(ZonedDateTime value)
      Copy the current immutable object by setting a value for the date attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for date
      Returns:
      A modified copy of the this object
    • withChanges

      public final CRelease withChanges(CChange... elements)
      Copy the current immutable object with elements that replace the content of changes.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withChanges

      public final CRelease withChanges(Iterable<? extends CChange> elements)
      Copy the current immutable object with elements that replace the content of changes. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of changes elements to set
      Returns:
      A modified copy of this object
    • withTicketSystemID

      public final CRelease withTicketSystemID(String value)
      Copy the current immutable object by setting a value for the ticketSystemID attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for ticketSystemID
      Returns:
      A modified copy of the this object
    • withVersion

      public final CRelease withVersion(CVersion value)
      Copy the current immutable object by setting a value for the version attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for version
      Returns:
      A modified copy of the this object
    • withOpen

      public final CRelease withOpen(boolean value)
      Copy the current immutable object by setting a value for the open attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for open
      Returns:
      A modified copy of the this object
    • equals

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

      public int hashCode()
      Computes a hash code from attributes: date, changes, ticketSystemID, version, open.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static CRelease copyOf(CReleaseType instance)
      Creates an immutable copy of a CReleaseType 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 CRelease instance
    • builder

      public static CRelease.Builder builder()
      Creates a builder for CRelease.
       CRelease.builder()
          .setDate(java.time.ZonedDateTime) // required date
          .addChanges|addAllChanges(CChange) // changes elements
          .setTicketSystemID(String) // required ticketSystemID
          .setVersion(com.io7m.changelog.core.CVersion) // required version
          .setOpen(boolean) // required open
          .build();
       
      Returns:
      A new CRelease builder