Package io.thestencil.client.api
Class ImmutableCreateTemplate.Builder
- java.lang.Object
-
- io.thestencil.client.api.ImmutableCreateTemplate.Builder
-
- Enclosing class:
- ImmutableCreateTemplate
@NotThreadSafe public static final class ImmutableCreateTemplate.Builder extends Object
Builds instances of typeImmutableCreateTemplate. 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableCreateTemplatebuild()Builds a newImmutableCreateTemplate.ImmutableCreateTemplate.Buildercontent(String content)Initializes the value for thecontentattribute.ImmutableCreateTemplate.Builderdescription(String description)Initializes the value for thedescriptionattribute.ImmutableCreateTemplate.Builderfrom(CreateBuilder.CreateTemplate instance)Fill a builder with attribute values from the providedCreateTemplateinstance.ImmutableCreateTemplate.Builderid(String id)Initializes the value for theidattribute.ImmutableCreateTemplate.Buildername(String name)Initializes the value for thenameattribute.ImmutableCreateTemplate.Buildertype(String type)Initializes the value for thetypeattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableCreateTemplate.Builder from(CreateBuilder.CreateTemplate instance)
Fill a builder with attribute values from the providedCreateTemplateinstance. 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 ImmutableCreateTemplate.Builder id(@Nullable String id)
Initializes the value for theidattribute.- Parameters:
id- The value for id (can benull)- Returns:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableCreateTemplate.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableCreateTemplate.Builder description(String description)
Initializes the value for thedescriptionattribute.- Parameters:
description- The value for description- Returns:
thisbuilder for use in a chained invocation
-
content
@CanIgnoreReturnValue public final ImmutableCreateTemplate.Builder content(String content)
Initializes the value for thecontentattribute.- Parameters:
content- The value for content- Returns:
thisbuilder for use in a chained invocation
-
type
@CanIgnoreReturnValue public final ImmutableCreateTemplate.Builder type(String type)
Initializes the value for thetypeattribute.- Parameters:
type- The value for type- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableCreateTemplate build()
Builds a newImmutableCreateTemplate.- Returns:
- An immutable instance of CreateTemplate
- Throws:
IllegalStateException- if any required attributes are missing
-
-