Package io.riada.insight.model
Class ImmutableTicket.Builder
java.lang.Object
io.riada.insight.model.ImmutableTicket.Builder
- Enclosing class:
- ImmutableTicket
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 Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutableTicket
.final ImmutableTicket.Builder
Fill a builder with attribute values from the providedTicket
instance.final ImmutableTicket.Builder
setCreated
(Instant created) Initializes the value for thecreated
attribute.final ImmutableTicket.Builder
Initializes the value for theid
attribute.final ImmutableTicket.Builder
Initializes the value for thekey
attribute.final ImmutableTicket.Builder
setPriority
(TicketPriority priority) Initializes the optional valuepriority
to priority.final ImmutableTicket.Builder
setPriority
(Optional<? extends TicketPriority> priority) Initializes the optional valuepriority
to priority.final ImmutableTicket.Builder
setReporter
(String reporter) Initializes the optional valuereporter
to reporter.final ImmutableTicket.Builder
setReporter
(Optional<String> reporter) Initializes the optional valuereporter
to reporter.final ImmutableTicket.Builder
setTicketStatus
(TicketStatus ticketStatus) Initializes the optional valueticketStatus
to ticketStatus.final ImmutableTicket.Builder
setTicketStatus
(Optional<? extends TicketStatus> ticketStatus) Initializes the optional valueticketStatus
to ticketStatus.final ImmutableTicket.Builder
Initializes the optional valuetitle
to title.final ImmutableTicket.Builder
Initializes the optional valuetitle
to title.final ImmutableTicket.Builder
setType
(TicketType type) Initializes the optional valuetype
to type.final ImmutableTicket.Builder
setType
(Optional<? extends TicketType> type) Initializes the optional valuetype
to type.final ImmutableTicket.Builder
setUpdated
(Instant updated) Initializes the value for theupdated
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedTicket
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
Initializes the value for theid
attribute.- Parameters:
id
- The value for id- Returns:
this
builder for use in a chained invocation
-
setKey
Initializes the value for thekey
attribute.- Parameters:
key
- The value for key- Returns:
this
builder for use in a chained invocation
-
setReporter
Initializes the optional valuereporter
to reporter.- Parameters:
reporter
- The value for reporter- Returns:
this
builder for chained invocation
-
setReporter
Initializes the optional valuereporter
to reporter.- Parameters:
reporter
- The value for reporter- Returns:
this
builder for use in a chained invocation
-
setCreated
Initializes the value for thecreated
attribute.- Parameters:
created
- The value for created- Returns:
this
builder for use in a chained invocation
-
setUpdated
Initializes the value for theupdated
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 valueticketStatus
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 valueticketStatus
to ticketStatus.- Parameters:
ticketStatus
- The value for ticketStatus- Returns:
this
builder for use in a chained invocation
-
setTitle
Initializes the optional valuetitle
to title.- Parameters:
title
- The value for title- Returns:
this
builder for chained invocation
-
setTitle
Initializes the optional valuetitle
to title.- Parameters:
title
- The value for title- Returns:
this
builder for use in a chained invocation
-
setType
Initializes the optional valuetype
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 valuetype
to type.- Parameters:
type
- The value for type- Returns:
this
builder for use in a chained invocation
-
setPriority
Initializes the optional valuepriority
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 valuepriority
to priority.- Parameters:
priority
- The value for priority- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableTicket
.- Returns:
- An immutable instance of Ticket
- Throws:
IllegalStateException
- if any required attributes are missing
-