Package com.orbitz.consul.model.agent
Class ImmutableAgent.Builder
- java.lang.Object
-
- com.orbitz.consul.model.agent.ImmutableAgent.Builder
-
- Enclosing class:
- ImmutableAgent
@NotThreadSafe public static final class ImmutableAgent.Builder extends java.lang.ObjectBuilds instances of typeImmutableAgent. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis 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 Type Method Description ImmutableAgentbuild()Builds a newImmutableAgent.ImmutableAgent.Builderconfig(Config config)Initializes the value for theconfigattribute.ImmutableAgent.BuilderdebugConfig(DebugConfig debugConfig)Initializes the value for thedebugConfigattribute.ImmutableAgent.Builderfrom(Agent instance)Fill a builder with attribute values from the providedAgentinstance.ImmutableAgent.Buildermember(Member member)Initializes the value for thememberattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableAgent.Builder from(Agent instance)
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.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
config
@CanIgnoreReturnValue public final ImmutableAgent.Builder config(Config 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
@CanIgnoreReturnValue public final ImmutableAgent.Builder member(Member member)
Initializes the value for thememberattribute.- Parameters:
member- The value for member- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableAgent build()
Builds a newImmutableAgent.- Returns:
- An immutable instance of Agent
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-