Class ImmutableEvent.Builder
java.lang.Object
org.kiwiproject.consul.model.event.ImmutableEvent.Builder
- Enclosing class:
- ImmutableEvent
Builds instances of type
ImmutableEvent
.
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 newImmutableEvent
.final ImmutableEvent.Builder
Fill a builder with attribute values from the providedEvent
instance.final ImmutableEvent.Builder
Initializes the value for theid
attribute.final ImmutableEvent.Builder
Initializes the value for thelTime
attribute.final ImmutableEvent.Builder
Initializes the value for thename
attribute.final ImmutableEvent.Builder
nodeFilter
(String nodeFilter) Initializes the optional valuenodeFilter
to nodeFilter.final ImmutableEvent.Builder
nodeFilter
(Optional<String> nodeFilter) Initializes the optional valuenodeFilter
to nodeFilter.final ImmutableEvent.Builder
Initializes the optional valuepayload
to payload.final ImmutableEvent.Builder
Initializes the optional valuepayload
to payload.final ImmutableEvent.Builder
serviceFilter
(String serviceFilter) Initializes the optional valueserviceFilter
to serviceFilter.final ImmutableEvent.Builder
serviceFilter
(Optional<String> serviceFilter) Initializes the optional valueserviceFilter
to serviceFilter.final ImmutableEvent.Builder
Initializes the optional valuetagFilter
to tagFilter.final ImmutableEvent.Builder
Initializes the optional valuetagFilter
to tagFilter.final ImmutableEvent.Builder
version
(int version) Initializes the value for theversion
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedEvent
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
-
id
Initializes the value for theid
attribute.- Parameters:
id
- The value for id- Returns:
this
builder for use in a chained invocation
-
name
Initializes the value for thename
attribute.- Parameters:
name
- The value for name- Returns:
this
builder for use in a chained invocation
-
payload
Initializes the optional valuepayload
to payload.- Parameters:
payload
- The value for payload- Returns:
this
builder for chained invocation
-
payload
Initializes the optional valuepayload
to payload.- Parameters:
payload
- The value for payload- Returns:
this
builder for use in a chained invocation
-
nodeFilter
Initializes the optional valuenodeFilter
to nodeFilter.- Parameters:
nodeFilter
- The value for nodeFilter- Returns:
this
builder for chained invocation
-
nodeFilter
Initializes the optional valuenodeFilter
to nodeFilter.- Parameters:
nodeFilter
- The value for nodeFilter- Returns:
this
builder for use in a chained invocation
-
serviceFilter
Initializes the optional valueserviceFilter
to serviceFilter.- Parameters:
serviceFilter
- The value for serviceFilter- Returns:
this
builder for chained invocation
-
serviceFilter
@CanIgnoreReturnValue public final ImmutableEvent.Builder serviceFilter(Optional<String> serviceFilter) Initializes the optional valueserviceFilter
to serviceFilter.- Parameters:
serviceFilter
- The value for serviceFilter- Returns:
this
builder for use in a chained invocation
-
tagFilter
Initializes the optional valuetagFilter
to tagFilter.- Parameters:
tagFilter
- The value for tagFilter- Returns:
this
builder for chained invocation
-
tagFilter
Initializes the optional valuetagFilter
to tagFilter.- Parameters:
tagFilter
- The value for tagFilter- Returns:
this
builder for use in a chained invocation
-
version
Initializes the value for theversion
attribute.- Parameters:
version
- The value for version- Returns:
this
builder for use in a chained invocation
-
lTime
Initializes the value for thelTime
attribute.- Parameters:
lTime
- The value for lTime- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableEvent
.- Returns:
- An immutable instance of Event
- Throws:
IllegalStateException
- if any required attributes are missing
-