Package com.orbitz.consul.model.query
Class ImmutableTemplate.Builder
- java.lang.Object
-
- com.orbitz.consul.model.query.ImmutableTemplate.Builder
-
- Enclosing class:
- ImmutableTemplate
@NotThreadSafe public static final class ImmutableTemplate.Builder extends java.lang.ObjectBuilds instances of typeImmutableTemplate. 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 ImmutableTemplatebuild()Builds a newImmutableTemplate.ImmutableTemplate.Builderfrom(Template instance)Fill a builder with attribute values from the providedTemplateinstance.ImmutableTemplate.BuilderregExp(java.lang.String regExp)Initializes the optional valueregExpto regExp.ImmutableTemplate.BuilderregExp(java.util.Optional<java.lang.String> regExp)Initializes the optional valueregExpto regExp.ImmutableTemplate.Buildertype(java.lang.String type)Initializes the value for thetypeattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableTemplate.Builder from(Template instance)
Fill a builder with attribute values from the providedTemplateinstance. 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
-
type
@CanIgnoreReturnValue public final ImmutableTemplate.Builder type(java.lang.String type)
Initializes the value for thetypeattribute.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
regExp
@CanIgnoreReturnValue public final ImmutableTemplate.Builder regExp(java.lang.String regExp)
Initializes the optional valueregExpto regExp.- Parameters:
regExp- The value for regExp- Returns:
thisbuilder for chained invocation
-
regExp
@CanIgnoreReturnValue public final ImmutableTemplate.Builder regExp(java.util.Optional<java.lang.String> regExp)
Initializes the optional valueregExpto regExp.- Parameters:
regExp- The value for regExp- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableTemplate build()
Builds a newImmutableTemplate.- Returns:
- An immutable instance of Template
- Throws:
java.lang.IllegalStateException- if any required attributes are missing
-
-