Package com.orbitz.consul.model.query
Class ImmutableStoredQuery.Builder
- java.lang.Object
-
- com.orbitz.consul.model.query.ImmutableStoredQuery.Builder
-
- Enclosing class:
- ImmutableStoredQuery
@NotThreadSafe public static final class ImmutableStoredQuery.Builder extends java.lang.ObjectBuilds instances of typeImmutableStoredQuery. 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 ImmutableStoredQuerybuild()Builds a newImmutableStoredQuery.ImmutableStoredQuery.Builderdns(DnsQuery dns)Initializes the value for thednsattribute.ImmutableStoredQuery.Builderfrom(StoredQuery instance)Fill a builder with attribute values from the providedStoredQueryinstance.ImmutableStoredQuery.Builderid(java.lang.String id)Initializes the value for theidattribute.ImmutableStoredQuery.Buildername(java.lang.String name)Initializes the value for thenameattribute.ImmutableStoredQuery.Builderservice(ServiceQuery service)Initializes the value for theserviceattribute.ImmutableStoredQuery.Buildersession(java.lang.String session)Initializes the value for thesessionattribute.ImmutableStoredQuery.Buildertoken(java.lang.String token)Initializes the value for thetokenattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableStoredQuery.Builder from(StoredQuery instance)
Fill a builder with attribute values from the providedStoredQueryinstance. 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
-
id
@CanIgnoreReturnValue public final ImmutableStoredQuery.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
-
name
@CanIgnoreReturnValue public final ImmutableStoredQuery.Builder name(java.lang.String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
session
@CanIgnoreReturnValue public final ImmutableStoredQuery.Builder session(java.lang.String session)
Initializes the value for thesessionattribute.- Parameters:
session- The value for session- Returns:
thisbuilder for use in a chained invocation
-
token
@CanIgnoreReturnValue public final ImmutableStoredQuery.Builder token(java.lang.String token)
Initializes the value for thetokenattribute.- Parameters:
token- The value for token- Returns:
thisbuilder for use in a chained invocation
-
service
@CanIgnoreReturnValue public final ImmutableStoredQuery.Builder service(ServiceQuery service)
Initializes the value for theserviceattribute.- Parameters:
service- The value for service- Returns:
thisbuilder for use in a chained invocation
-
dns
@CanIgnoreReturnValue public final ImmutableStoredQuery.Builder dns(DnsQuery dns)
Initializes the value for thednsattribute.- Parameters:
dns- The value for dns- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableStoredQuery build()
Builds a newImmutableStoredQuery.- Returns:
- An immutable instance of StoredQuery
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-