Package com.orbitz.consul.model.agent
Class ImmutableFullService.Builder
- java.lang.Object
-
- com.orbitz.consul.model.agent.ImmutableFullService.Builder
-
- Enclosing class:
- ImmutableFullService
@NotThreadSafe public static final class ImmutableFullService.Builder extends java.lang.ObjectBuilds instances of typeImmutableFullService. 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 ImmutableFullService.BuilderaddAllTags(java.lang.Iterable<java.lang.String> elements)Adds elements totagslist.ImmutableFullService.Builderaddress(java.lang.String address)Initializes the value for theaddressattribute.ImmutableFullService.BuilderaddTags(java.lang.String element)Adds one element totagslist.ImmutableFullService.BuilderaddTags(java.lang.String... elements)Adds elements totagslist.ImmutableFullServicebuild()Builds a newImmutableFullService.ImmutableFullService.BuildercontentHash(java.lang.String contentHash)Initializes the value for thecontentHashattribute.ImmutableFullService.BuilderenableTagOverride(boolean enableTagOverride)Initializes the optional valueenableTagOverrideto enableTagOverride.ImmutableFullService.BuilderenableTagOverride(java.util.Optional<java.lang.Boolean> enableTagOverride)Initializes the optional valueenableTagOverrideto enableTagOverride.ImmutableFullService.Builderfrom(FullService instance)Fill a builder with attribute values from the providedFullServiceinstance.ImmutableFullService.Builderid(java.lang.String id)Initializes the value for theidattribute.ImmutableFullService.Builderkind(java.lang.String kind)Initializes the optional valuekindto kind.ImmutableFullService.Builderkind(java.util.Optional<java.lang.String> kind)Initializes the optional valuekindto kind.ImmutableFullService.Buildermeta(java.util.Map<java.lang.String,? extends java.lang.String> entries)Sets or replaces all mappings from the specified map as entries for themetamap.ImmutableFullService.Builderport(int port)Initializes the value for theportattribute.ImmutableFullService.Builderproxy(ServiceProxy proxy)Initializes the optional valueproxyto proxy.ImmutableFullService.Builderproxy(java.util.Optional<? extends ServiceProxy> proxy)Initializes the optional valueproxyto proxy.ImmutableFullService.BuilderputAllMeta(java.util.Map<java.lang.String,? extends java.lang.String> entries)Put all mappings from the specified map as entries tometamap.ImmutableFullService.BuilderputMeta(java.lang.String key, java.lang.String value)Put one entry to themetamap.ImmutableFullService.BuilderputMeta(java.util.Map.Entry<java.lang.String,? extends java.lang.String> entry)Put one entry to themetamap.ImmutableFullService.Builderservice(java.lang.String service)Initializes the value for theserviceattribute.ImmutableFullService.Buildertags(java.lang.Iterable<java.lang.String> elements)Sets or replaces all elements fortagslist.ImmutableFullService.Builderweights(ServiceWeights weights)Initializes the optional valueweightsto weights.ImmutableFullService.Builderweights(java.util.Optional<? extends ServiceWeights> weights)Initializes the optional valueweightsto weights.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableFullService.Builder from(FullService instance)
Fill a builder with attribute values from the providedFullServiceinstance. 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
-
kind
@CanIgnoreReturnValue public final ImmutableFullService.Builder kind(java.lang.String kind)
Initializes the optional valuekindto kind.- Parameters:
kind- The value for kind- Returns:
thisbuilder for chained invocation
-
kind
@CanIgnoreReturnValue public final ImmutableFullService.Builder kind(java.util.Optional<java.lang.String> kind)
Initializes the optional valuekindto kind.- Parameters:
kind- The value for kind- Returns:
thisbuilder for use in a chained invocation
-
id
@CanIgnoreReturnValue public final ImmutableFullService.Builder id(java.lang.String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id- Returns:
thisbuilder for use in a chained invocation
-
service
@CanIgnoreReturnValue public final ImmutableFullService.Builder service(java.lang.String service)
Initializes the value for theserviceattribute.- Parameters:
service- The value for service- Returns:
thisbuilder for use in a chained invocation
-
addTags
@CanIgnoreReturnValue public final ImmutableFullService.Builder addTags(java.lang.String element)
Adds one element totagslist.- Parameters:
element- A tags element- Returns:
thisbuilder for use in a chained invocation
-
addTags
@CanIgnoreReturnValue public final ImmutableFullService.Builder addTags(java.lang.String... elements)
Adds elements totagslist.- Parameters:
elements- An array of tags elements- Returns:
thisbuilder for use in a chained invocation
-
tags
@CanIgnoreReturnValue public final ImmutableFullService.Builder tags(java.lang.Iterable<java.lang.String> elements)
Sets or replaces all elements fortagslist.- Parameters:
elements- An iterable of tags elements- Returns:
thisbuilder for use in a chained invocation
-
addAllTags
@CanIgnoreReturnValue public final ImmutableFullService.Builder addAllTags(java.lang.Iterable<java.lang.String> elements)
Adds elements totagslist.- Parameters:
elements- An iterable of tags elements- Returns:
thisbuilder for use in a chained invocation
-
putMeta
@CanIgnoreReturnValue public final ImmutableFullService.Builder putMeta(java.lang.String key, java.lang.String value)
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 ImmutableFullService.Builder putMeta(java.util.Map.Entry<java.lang.String,? extends java.lang.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 ImmutableFullService.Builder meta(java.util.Map<java.lang.String,? extends java.lang.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 ImmutableFullService.Builder putAllMeta(java.util.Map<java.lang.String,? extends java.lang.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
-
port
@CanIgnoreReturnValue public final ImmutableFullService.Builder port(int port)
Initializes the value for theportattribute.- Parameters:
port- The value for port- Returns:
thisbuilder for use in a chained invocation
-
address
@CanIgnoreReturnValue public final ImmutableFullService.Builder address(java.lang.String address)
Initializes the value for theaddressattribute.- Parameters:
address- The value for address- Returns:
thisbuilder for use in a chained invocation
-
weights
@CanIgnoreReturnValue public final ImmutableFullService.Builder weights(ServiceWeights weights)
Initializes the optional valueweightsto weights.- Parameters:
weights- The value for weights- Returns:
thisbuilder for chained invocation
-
weights
@CanIgnoreReturnValue public final ImmutableFullService.Builder weights(java.util.Optional<? extends ServiceWeights> weights)
Initializes the optional valueweightsto weights.- Parameters:
weights- The value for weights- Returns:
thisbuilder for use in a chained invocation
-
enableTagOverride
@CanIgnoreReturnValue public final ImmutableFullService.Builder enableTagOverride(boolean enableTagOverride)
Initializes the optional valueenableTagOverrideto enableTagOverride.- Parameters:
enableTagOverride- The value for enableTagOverride- Returns:
thisbuilder for chained invocation
-
enableTagOverride
@CanIgnoreReturnValue public final ImmutableFullService.Builder enableTagOverride(java.util.Optional<java.lang.Boolean> enableTagOverride)
Initializes the optional valueenableTagOverrideto enableTagOverride.- Parameters:
enableTagOverride- The value for enableTagOverride- Returns:
thisbuilder for use in a chained invocation
-
contentHash
@CanIgnoreReturnValue public final ImmutableFullService.Builder contentHash(java.lang.String contentHash)
Initializes the value for thecontentHashattribute.- Parameters:
contentHash- The value for contentHash- Returns:
thisbuilder for use in a chained invocation
-
proxy
@CanIgnoreReturnValue public final ImmutableFullService.Builder proxy(ServiceProxy proxy)
Initializes the optional valueproxyto proxy.- Parameters:
proxy- The value for proxy- Returns:
thisbuilder for chained invocation
-
proxy
@CanIgnoreReturnValue public final ImmutableFullService.Builder proxy(java.util.Optional<? extends ServiceProxy> proxy)
Initializes the optional valueproxyto proxy.- Parameters:
proxy- The value for proxy- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableFullService build()
Builds a newImmutableFullService.- Returns:
- An immutable instance of FullService
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-