Class CTicketSystem

java.lang.Object
com.io7m.changelog.core.CTicketSystem
All Implemented Interfaces:
CTicketSystemType

public final class CTicketSystem extends Object implements CTicketSystemType
The definition of a ticket system.
  • Method Details

    • id

      public String id()
      Specified by:
      id in interface CTicketSystemType
      Returns:
      The ID of the ticket system
    • uri

      public URI uri()
      Specified by:
      uri in interface CTicketSystemType
      Returns:
      The URI for the ticket system
    • isDefault

      public boolean isDefault()
      Specified by:
      isDefault in interface CTicketSystemType
      Returns:
      true if the ticket system is the current default
    • withId

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

      public final CTicketSystem withUri(URI value)
      Copy the current immutable object by setting a value for the uri attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for uri
      Returns:
      A modified copy of the this object
    • withDefault

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

      public boolean equals(Object another)
      This instance is equal to all instances of CTicketSystem 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: id, uri, isDefault.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static CTicketSystem.Builder builder()
      Creates a builder for CTicketSystem.
       CTicketSystem.builder()
          .setId(String) // required id
          .setUri(java.net.URI) // required uri
          .setDefault(boolean) // optional default
          .build();
       
      Returns:
      A new CTicketSystem builder