Package io.thestencil.staticontent.api
Class ImmutableHeading.Builder
- java.lang.Object
-
- io.thestencil.staticontent.api.ImmutableHeading.Builder
-
- Enclosing class:
- ImmutableHeading
@NotThreadSafe public static final class ImmutableHeading.Builder extends Object
Builds instances of typeImmutableHeading. 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 ImmutableHeadingbuild()Builds a newImmutableHeading.ImmutableHeading.Builderfrom(StaticContentClient.Heading instance)Fill a builder with attribute values from the providedHeadinginstance.ImmutableHeading.Builderlevel(Integer level)Initializes the value for thelevelattribute.ImmutableHeading.Buildername(String name)Initializes the value for thenameattribute.ImmutableHeading.Builderorder(Integer order)Initializes the value for theorderattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableHeading.Builder from(StaticContentClient.Heading instance)
Fill a builder with attribute values from the providedHeadinginstance. 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
-
order
@CanIgnoreReturnValue public final ImmutableHeading.Builder order(Integer order)
Initializes the value for theorderattribute.- Parameters:
order- The value for order- Returns:
thisbuilder for use in a chained invocation
-
level
@CanIgnoreReturnValue public final ImmutableHeading.Builder level(Integer level)
Initializes the value for thelevelattribute.- Parameters:
level- The value for level- Returns:
thisbuilder for use in a chained invocation
-
name
@CanIgnoreReturnValue public final ImmutableHeading.Builder name(String name)
Initializes the value for thenameattribute.- Parameters:
name- The value for name- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableHeading build()
Builds a newImmutableHeading.- Returns:
- An immutable instance of Heading
- Throws:
IllegalStateException- if any required attributes are missing
-
-