Class ImmutableTicket

java.lang.Object
io.riada.insight.model.Ticket
io.riada.insight.model.ImmutableTicket

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableTicket extends Ticket
Immutable implementation of Ticket.

Use the builder to create immutable instances: ImmutableTicket.builder().

  • Method Details

    • id

      public Long id()
      Specified by:
      id in class Ticket
      Returns:
      The value of the id attribute
    • key

      public String key()
      Specified by:
      key in class Ticket
      Returns:
      The value of the key attribute
    • reporter

      public Optional<String> reporter()
      Specified by:
      reporter in class Ticket
      Returns:
      The value of the reporter attribute
    • created

      public Instant created()
      Specified by:
      created in class Ticket
      Returns:
      The value of the created attribute
    • updated

      public Instant updated()
      Specified by:
      updated in class Ticket
      Returns:
      The value of the updated attribute
    • ticketStatus

      public Optional<TicketStatus> ticketStatus()
      Specified by:
      ticketStatus in class Ticket
      Returns:
      The value of the ticketStatus attribute
    • title

      public Optional<String> title()
      Specified by:
      title in class Ticket
      Returns:
      The value of the title attribute
    • type

      public Optional<TicketType> type()
      Specified by:
      type in class Ticket
      Returns:
      The value of the type attribute
    • priority

      public Optional<TicketPriority> priority()
      Specified by:
      priority in class Ticket
      Returns:
      The value of the priority attribute
    • withId

      public final ImmutableTicket withId(Long 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
    • withKey

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

      public final ImmutableTicket withReporter(String value)
      Copy the current immutable object by setting a present value for the optional reporter attribute.
      Parameters:
      value - The value for reporter
      Returns:
      A modified copy of this object
    • withReporter

      public final ImmutableTicket withReporter(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the reporter attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for reporter
      Returns:
      A modified copy of this object
    • withCreated

      public final ImmutableTicket withCreated(Instant value)
      Copy the current immutable object by setting a value for the created attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for created
      Returns:
      A modified copy of the this object
    • withUpdated

      public final ImmutableTicket withUpdated(Instant value)
      Copy the current immutable object by setting a value for the updated attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for updated
      Returns:
      A modified copy of the this object
    • withTicketStatus

      public final ImmutableTicket withTicketStatus(TicketStatus value)
      Copy the current immutable object by setting a present value for the optional ticketStatus attribute.
      Parameters:
      value - The value for ticketStatus
      Returns:
      A modified copy of this object
    • withTicketStatus

      public final ImmutableTicket withTicketStatus(Optional<? extends TicketStatus> optional)
      Copy the current immutable object by setting an optional value for the ticketStatus attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for ticketStatus
      Returns:
      A modified copy of this object
    • withTitle

      public final ImmutableTicket withTitle(String value)
      Copy the current immutable object by setting a present value for the optional title attribute.
      Parameters:
      value - The value for title
      Returns:
      A modified copy of this object
    • withTitle

      public final ImmutableTicket withTitle(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the title attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for title
      Returns:
      A modified copy of this object
    • withType

      public final ImmutableTicket withType(TicketType value)
      Copy the current immutable object by setting a present value for the optional type attribute.
      Parameters:
      value - The value for type
      Returns:
      A modified copy of this object
    • withType

      public final ImmutableTicket withType(Optional<? extends TicketType> optional)
      Copy the current immutable object by setting an optional value for the type attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for type
      Returns:
      A modified copy of this object
    • withPriority

      public final ImmutableTicket withPriority(TicketPriority value)
      Copy the current immutable object by setting a present value for the optional priority attribute.
      Parameters:
      value - The value for priority
      Returns:
      A modified copy of this object
    • withPriority

      public final ImmutableTicket withPriority(Optional<? extends TicketPriority> optional)
      Copy the current immutable object by setting an optional value for the priority attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for priority
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableTicket 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, key, reporter, created, updated, ticketStatus, title, type, priority.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

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

      public static ImmutableTicket.Builder builder()
      Creates a builder for ImmutableTicket.
       ImmutableTicket.builder()
          .setId(Long) // required id
          .setKey(String) // required key
          .setReporter(String) // optional reporter
          .setCreated(java.time.Instant) // required created
          .setUpdated(java.time.Instant) // required updated
          .setTicketStatus(io.riada.insight.model.TicketStatus) // optional ticketStatus
          .setTitle(String) // optional title
          .setType(io.riada.insight.model.TicketType) // optional type
          .setPriority(io.riada.insight.model.TicketPriority) // optional priority
          .build();
       
      Returns:
      A new ImmutableTicket builder