Package com.orbitz.consul.model.catalog
Class ImmutableCatalogNode.Builder
- java.lang.Object
-
- com.orbitz.consul.model.catalog.ImmutableCatalogNode.Builder
-
- Enclosing class:
- ImmutableCatalogNode
@NotThreadSafe public static final class ImmutableCatalogNode.Builder extends java.lang.ObjectBuilds instances of typeImmutableCatalogNode. 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 ImmutableCatalogNodebuild()Builds a newImmutableCatalogNode.ImmutableCatalogNode.Builderfrom(CatalogNode instance)Fill a builder with attribute values from the providedCatalogNodeinstance.ImmutableCatalogNode.Buildernode(Node node)Initializes the value for thenodeattribute.ImmutableCatalogNode.BuilderputAllServices(java.util.Map<java.lang.String,? extends Service> entries)Put all mappings from the specified map as entries toservicesmap.ImmutableCatalogNode.BuilderputServices(java.lang.String key, Service value)Put one entry to theservicesmap.ImmutableCatalogNode.BuilderputServices(java.util.Map.Entry<java.lang.String,? extends Service> entry)Put one entry to theservicesmap.ImmutableCatalogNode.Builderservices(java.util.Map<java.lang.String,? extends Service> entries)Sets or replaces all mappings from the specified map as entries for theservicesmap.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableCatalogNode.Builder from(CatalogNode instance)
Fill a builder with attribute values from the providedCatalogNodeinstance. 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
-
node
@CanIgnoreReturnValue public final ImmutableCatalogNode.Builder node(Node node)
Initializes the value for thenodeattribute.- Parameters:
node- The value for node- Returns:
thisbuilder for use in a chained invocation
-
putServices
@CanIgnoreReturnValue public final ImmutableCatalogNode.Builder putServices(java.lang.String key, Service value)
Put one entry to theservicesmap.- Parameters:
key- The key in the services mapvalue- The associated value in the services map- Returns:
thisbuilder for use in a chained invocation
-
putServices
@CanIgnoreReturnValue public final ImmutableCatalogNode.Builder putServices(java.util.Map.Entry<java.lang.String,? extends Service> entry)
Put one entry to theservicesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
services
@CanIgnoreReturnValue public final ImmutableCatalogNode.Builder services(java.util.Map<java.lang.String,? extends Service> entries)
Sets or replaces all mappings from the specified map as entries for theservicesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the services map- Returns:
thisbuilder for use in a chained invocation
-
putAllServices
@CanIgnoreReturnValue public final ImmutableCatalogNode.Builder putAllServices(java.util.Map<java.lang.String,? extends Service> entries)
Put all mappings from the specified map as entries toservicesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the services map- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableCatalogNode build()
Builds a newImmutableCatalogNode.- Returns:
- An immutable instance of CatalogNode
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-