Package com.orbitz.consul.cache
Class ImmutableServiceHealthKey.Builder
- java.lang.Object
-
- com.orbitz.consul.cache.ImmutableServiceHealthKey.Builder
-
- Enclosing class:
- ImmutableServiceHealthKey
@NotThreadSafe public static final class ImmutableServiceHealthKey.Builder extends java.lang.ObjectBuilds instances of typeImmutableServiceHealthKey. 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 ImmutableServiceHealthKeybuild()Builds a newImmutableServiceHealthKey.ImmutableServiceHealthKey.Builderfrom(ServiceHealthKey instance)Fill a builder with attribute values from the providedServiceHealthKeyinstance.ImmutableServiceHealthKey.Builderhost(java.lang.String host)Initializes the value for thehostattribute.ImmutableServiceHealthKey.Builderport(java.lang.Integer port)Initializes the value for theportattribute.ImmutableServiceHealthKey.BuilderserviceId(java.lang.String serviceId)Initializes the value for theserviceIdattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableServiceHealthKey.Builder from(ServiceHealthKey instance)
Fill a builder with attribute values from the providedServiceHealthKeyinstance. 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
-
serviceId
@CanIgnoreReturnValue public final ImmutableServiceHealthKey.Builder serviceId(java.lang.String serviceId)
Initializes the value for theserviceIdattribute.- Parameters:
serviceId- The value for serviceId- Returns:
thisbuilder for use in a chained invocation
-
host
@CanIgnoreReturnValue public final ImmutableServiceHealthKey.Builder host(java.lang.String host)
Initializes the value for thehostattribute.- Parameters:
host- The value for host- Returns:
thisbuilder for use in a chained invocation
-
port
@CanIgnoreReturnValue public final ImmutableServiceHealthKey.Builder port(java.lang.Integer port)
Initializes the value for theportattribute.- Parameters:
port- The value for port- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableServiceHealthKey build()
Builds a newImmutableServiceHealthKey.- Returns:
- An immutable instance of ServiceHealthKey
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-