Class CRelease

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

public final class CRelease
extends java.lang.Object
implements CReleaseType
A specific release in a changelog.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  CRelease.Builder
    Builds instances of type CRelease.
  • Method Summary

    Modifier and Type Method Description
    static CRelease.Builder builder()
    Creates a builder for CRelease.
    java.util.List<CChange> changes()  
    static CRelease copyOf​(CReleaseType instance)
    Creates an immutable copy of a CReleaseType value.
    java.time.ZonedDateTime date()  
    boolean equals​(java.lang.Object another)
    This instance is equal to all instances of CRelease that have equal attribute values.
    int hashCode()
    Computes a hash code from attributes: date, changes, ticketSystemID, version, open.
    boolean isOpen()  
    java.lang.String ticketSystemID()  
    java.lang.String toString()
    Prints the immutable value CRelease with attribute values.
    CVersion version()  
    CRelease withChanges​(CChange... elements)
    Copy the current immutable object with elements that replace the content of changes.
    CRelease withChanges​(java.lang.Iterable<? extends CChange> elements)
    Copy the current immutable object with elements that replace the content of changes.
    CRelease withDate​(java.time.ZonedDateTime value)
    Copy the current immutable object by setting a value for the date attribute.
    CRelease withOpen​(boolean value)
    Copy the current immutable object by setting a value for the open attribute.
    CRelease withTicketSystemID​(java.lang.String value)
    Copy the current immutable object by setting a value for the ticketSystemID attribute.
    CRelease withVersion​(CVersion value)
    Copy the current immutable object by setting a value for the version attribute.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • date

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

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

      public java.lang.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​(java.time.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​(java.lang.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​(java.lang.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​(java.lang.Object another)
      This instance is equal to all instances of CRelease 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: date, changes, ticketSystemID, version, open.
      Overrides:
      hashCode in class java.lang.Object
      Returns:
      hashCode value
    • toString

      public java.lang.String toString()
      Prints the immutable value CRelease with attribute values.
      Overrides:
      toString in class java.lang.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