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.BuilderFill a builder with attribute values from the providedEventinstance.final ImmutableEvent.BuilderInitializes the value for theidattribute.final ImmutableEvent.BuilderInitializes the value for thelTimeattribute.final ImmutableEvent.BuilderInitializes the value for thenameattribute.final ImmutableEvent.BuildernodeFilter(String nodeFilter) Initializes the optional valuenodeFilterto nodeFilter.final ImmutableEvent.BuildernodeFilter(Optional<String> nodeFilter) Initializes the optional valuenodeFilterto nodeFilter.final ImmutableEvent.BuilderInitializes the optional valuepayloadto payload.final ImmutableEvent.BuilderInitializes the optional valuepayloadto payload.final ImmutableEvent.BuilderserviceFilter(String serviceFilter) Initializes the optional valueserviceFilterto serviceFilter.final ImmutableEvent.BuilderserviceFilter(Optional<String> serviceFilter) Initializes the optional valueserviceFilterto serviceFilter.final ImmutableEvent.BuilderInitializes the optional valuetagFilterto tagFilter.final ImmutableEvent.BuilderInitializes the optional valuetagFilterto tagFilter.final ImmutableEvent.Builderversion(int version) Initializes the value for theversionattribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedEventinstance. 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:
thisbuilder for use in a chained invocation
-
id
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
name
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
payload
Initializes the optional valuepayloadto payload.- Parameters:
payload- The value for payload- Returns:
thisbuilder for chained invocation
-
payload
Initializes the optional valuepayloadto payload.- Parameters:
payload- The value for payload- Returns:
thisbuilder for use in a chained invocation
-
nodeFilter
Initializes the optional valuenodeFilterto nodeFilter.- Parameters:
nodeFilter- The value for nodeFilter- Returns:
thisbuilder for chained invocation
-
nodeFilter
Initializes the optional valuenodeFilterto nodeFilter.- Parameters:
nodeFilter- The value for nodeFilter- Returns:
thisbuilder for use in a chained invocation
-
serviceFilter
Initializes the optional valueserviceFilterto serviceFilter.- Parameters:
serviceFilter- The value for serviceFilter- Returns:
thisbuilder for chained invocation
-
serviceFilter
@CanIgnoreReturnValue public final ImmutableEvent.Builder serviceFilter(Optional<String> serviceFilter) Initializes the optional valueserviceFilterto serviceFilter.- Parameters:
serviceFilter- The value for serviceFilter- Returns:
thisbuilder for use in a chained invocation
-
tagFilter
Initializes the optional valuetagFilterto tagFilter.- Parameters:
tagFilter- The value for tagFilter- Returns:
thisbuilder for chained invocation
-
tagFilter
Initializes the optional valuetagFilterto tagFilter.- Parameters:
tagFilter- The value for tagFilter- Returns:
thisbuilder for use in a chained invocation
-
version
Initializes the value for theversionattribute.- Parameters:
version- The value for version- Returns:
thisbuilder for use in a chained invocation
-
lTime
Initializes the value for thelTimeattribute.- Parameters:
lTime- The value for lTime- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableEvent.- Returns:
- An immutable instance of Event
- Throws:
IllegalStateException- if any required attributes are missing
-