@NotThreadSafe public static final class ImmutableTicket.Builder extends Object
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.
| Modifier and Type | Method and Description |
|---|---|
ImmutableTicket |
build()
Builds a new
ImmutableTicket. |
ImmutableTicket.Builder |
from(Ticket instance)
Fill a builder with attribute values from the provided
Ticket instance. |
ImmutableTicket.Builder |
setCreated(Instant created)
Initializes the value for the
created attribute. |
ImmutableTicket.Builder |
setId(Long id)
Initializes the value for the
id attribute. |
ImmutableTicket.Builder |
setKey(String key)
Initializes the value for the
key attribute. |
ImmutableTicket.Builder |
setPriority(Optional<? extends TicketPriority> priority)
Initializes the optional value
priority to priority. |
ImmutableTicket.Builder |
setPriority(TicketPriority priority)
Initializes the optional value
priority to priority. |
ImmutableTicket.Builder |
setReporter(Optional<String> reporter)
Initializes the optional value
reporter to reporter. |
ImmutableTicket.Builder |
setReporter(String reporter)
Initializes the optional value
reporter to reporter. |
ImmutableTicket.Builder |
setTicketStatus(Optional<? extends TicketStatus> ticketStatus)
Initializes the optional value
ticketStatus to ticketStatus. |
ImmutableTicket.Builder |
setTicketStatus(TicketStatus ticketStatus)
Initializes the optional value
ticketStatus to ticketStatus. |
ImmutableTicket.Builder |
setTitle(Optional<String> title)
Initializes the optional value
title to title. |
ImmutableTicket.Builder |
setTitle(String title)
Initializes the optional value
title to title. |
ImmutableTicket.Builder |
setType(Optional<? extends TicketType> type)
Initializes the optional value
type to type. |
ImmutableTicket.Builder |
setType(TicketType type)
Initializes the optional value
type to type. |
ImmutableTicket.Builder |
setUpdated(Instant updated)
Initializes the value for the
updated attribute. |
@CanIgnoreReturnValue public final ImmutableTicket.Builder from(Ticket instance)
Ticket instance.
Regular attribute values will be replaced with those from the given instance.
Absent optional values will not replace present values.instance - The instance from which to copy valuesthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setId(Long id)
id attribute.id - The value for idthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setKey(String key)
key attribute.key - The value for keythis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setReporter(String reporter)
reporter to reporter.reporter - The value for reporterthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setReporter(Optional<String> reporter)
reporter to reporter.reporter - The value for reporterthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setCreated(Instant created)
created attribute.created - The value for createdthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setUpdated(Instant updated)
updated attribute.updated - The value for updatedthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setTicketStatus(TicketStatus ticketStatus)
ticketStatus to ticketStatus.ticketStatus - The value for ticketStatusthis builder for chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setTicketStatus(Optional<? extends TicketStatus> ticketStatus)
ticketStatus to ticketStatus.ticketStatus - The value for ticketStatusthis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setTitle(String title)
title to title.title - The value for titlethis builder for chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setTitle(Optional<String> title)
title to title.title - The value for titlethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setType(TicketType type)
type to type.type - The value for typethis builder for chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setType(Optional<? extends TicketType> type)
type to type.type - The value for typethis builder for use in a chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setPriority(TicketPriority priority)
priority to priority.priority - The value for prioritythis builder for chained invocation@CanIgnoreReturnValue public final ImmutableTicket.Builder setPriority(Optional<? extends TicketPriority> priority)
priority to priority.priority - The value for prioritythis builder for use in a chained invocationpublic ImmutableTicket build()
ImmutableTicket.IllegalStateException - if any required attributes are missingCopyright © 2024 Atlassian. All rights reserved.