Class ImmutableAgent.Builder
java.lang.Object
org.kiwiproject.consul.model.agent.ImmutableAgent.Builder
- Enclosing class:
- ImmutableAgent
Builds instances of type
ImmutableAgent.
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 newImmutableAgent.final ImmutableAgent.BuilderInitializes the value for theconfigattribute.final ImmutableAgent.BuilderdebugConfig(@Nullable DebugConfig debugConfig) Initializes the value for thedebugConfigattribute.final ImmutableAgent.BuilderFill a builder with attribute values from the providedAgentinstance.final ImmutableAgent.BuilderInitializes the value for thememberattribute.final ImmutableAgent.BuilderSets or replaces all mappings from the specified map as entries for themetamap.final ImmutableAgent.BuilderputAllMeta(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tometamap.final ImmutableAgent.BuilderPut one entry to themetamap.final ImmutableAgent.BuilderPut one entry to themetamap.
-
Method Details
-
from
Fill a builder with attribute values from the providedAgentinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
config
Initializes the value for theconfigattribute.- Parameters:
config- The value for config- Returns:
thisbuilder for use in a chained invocation
-
debugConfig
@CanIgnoreReturnValue public final ImmutableAgent.Builder debugConfig(@Nullable DebugConfig debugConfig) Initializes the value for thedebugConfigattribute.- Parameters:
debugConfig- The value for debugConfig (can benull)- Returns:
thisbuilder for use in a chained invocation
-
member
Initializes the value for thememberattribute.- Parameters:
member- The value for member- Returns:
thisbuilder for use in a chained invocation
-
putMeta
Put one entry to themetamap.- Parameters:
key- The key in the meta mapvalue- The associated value in the meta map- Returns:
thisbuilder for use in a chained invocation
-
putMeta
@CanIgnoreReturnValue public final ImmutableAgent.Builder putMeta(Map.Entry<String, ? extends String> entry) Put one entry to themetamap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
meta
@CanIgnoreReturnValue public final ImmutableAgent.Builder meta(Map<String, ? extends String> entries) Sets or replaces all mappings from the specified map as entries for themetamap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the meta map- Returns:
thisbuilder for use in a chained invocation
-
putAllMeta
@CanIgnoreReturnValue public final ImmutableAgent.Builder putAllMeta(Map<String, ? extends String> entries) Put all mappings from the specified map as entries tometamap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the meta map- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableAgent.- Returns:
- An immutable instance of Agent
- Throws:
IllegalStateException- if any required attributes are missing
-