Class ImmutableTicket.Builder

java.lang.Object
io.riada.insight.model.ImmutableTicket.Builder
Enclosing class:
ImmutableTicket

@NotThreadSafe public static final class ImmutableTicket.Builder extends Object
Builds instances of type ImmutableTicket. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      @CanIgnoreReturnValue public final ImmutableTicket.Builder from(Ticket instance)
      Fill a builder with attribute values from the provided Ticket instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
      Parameters:
      instance - The instance from which to copy values
      Returns:
      this builder for use in a chained invocation
    • setId

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setId(Long id)
      Initializes the value for the id attribute.
      Parameters:
      id - The value for id
      Returns:
      this builder for use in a chained invocation
    • setKey

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setKey(String key)
      Initializes the value for the key attribute.
      Parameters:
      key - The value for key
      Returns:
      this builder for use in a chained invocation
    • setReporter

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setReporter(String reporter)
      Initializes the optional value reporter to reporter.
      Parameters:
      reporter - The value for reporter
      Returns:
      this builder for chained invocation
    • setReporter

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setReporter(Optional<String> reporter)
      Initializes the optional value reporter to reporter.
      Parameters:
      reporter - The value for reporter
      Returns:
      this builder for use in a chained invocation
    • setCreated

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setCreated(Instant created)
      Initializes the value for the created attribute.
      Parameters:
      created - The value for created
      Returns:
      this builder for use in a chained invocation
    • setUpdated

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setUpdated(Instant updated)
      Initializes the value for the updated attribute.
      Parameters:
      updated - The value for updated
      Returns:
      this builder for use in a chained invocation
    • setTicketStatus

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setTicketStatus(TicketStatus ticketStatus)
      Initializes the optional value ticketStatus to ticketStatus.
      Parameters:
      ticketStatus - The value for ticketStatus
      Returns:
      this builder for chained invocation
    • setTicketStatus

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setTicketStatus(Optional<? extends TicketStatus> ticketStatus)
      Initializes the optional value ticketStatus to ticketStatus.
      Parameters:
      ticketStatus - The value for ticketStatus
      Returns:
      this builder for use in a chained invocation
    • setTitle

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setTitle(String title)
      Initializes the optional value title to title.
      Parameters:
      title - The value for title
      Returns:
      this builder for chained invocation
    • setTitle

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setTitle(Optional<String> title)
      Initializes the optional value title to title.
      Parameters:
      title - The value for title
      Returns:
      this builder for use in a chained invocation
    • setType

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setType(TicketType type)
      Initializes the optional value type to type.
      Parameters:
      type - The value for type
      Returns:
      this builder for chained invocation
    • setType

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setType(Optional<? extends TicketType> type)
      Initializes the optional value type to type.
      Parameters:
      type - The value for type
      Returns:
      this builder for use in a chained invocation
    • setPriority

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setPriority(TicketPriority priority)
      Initializes the optional value priority to priority.
      Parameters:
      priority - The value for priority
      Returns:
      this builder for chained invocation
    • setPriority

      @CanIgnoreReturnValue public final ImmutableTicket.Builder setPriority(Optional<? extends TicketPriority> priority)
      Initializes the optional value priority to priority.
      Parameters:
      priority - The value for priority
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutableTicket build()
      Builds a new ImmutableTicket.
      Returns:
      An immutable instance of Ticket
      Throws:
      IllegalStateException - if any required attributes are missing