Package io.dialob.boot.controller
Class ImmutablePageAttributes.Builder
- java.lang.Object
-
- io.dialob.boot.controller.ImmutablePageAttributes.Builder
-
- Enclosing class:
- ImmutablePageAttributes
@NotThreadSafe public static final class ImmutablePageAttributes.Builder extends Object
Builds instances of typeImmutablePageAttributes. 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 ImmutablePageAttributes.Builderattributes(Map<String,? extends Object> entries)Sets or replaces all mappings from the specified map as entries for theattributesmap.ImmutablePageAttributesbuild()Builds a newImmutablePageAttributes.ImmutablePageAttributes.Builderfrom(PageAttributes instance)Fill a builder with attribute values from the providedPageAttributesinstance.ImmutablePageAttributes.BuilderputAllAttributes(Map<String,? extends Object> entries)Put all mappings from the specified map as entries toattributesmap.ImmutablePageAttributes.BuilderputAttributes(String key, Object value)Put one entry to theattributesmap.ImmutablePageAttributes.BuilderputAttributes(Map.Entry<String,? extends Object> entry)Put one entry to theattributesmap.ImmutablePageAttributes.Buildertemplate(String template)Initializes the value for thetemplateattribute.
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutablePageAttributes.Builder from(PageAttributes instance)
Fill a builder with attribute values from the providedPageAttributesinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
putAttributes
@CanIgnoreReturnValue public final ImmutablePageAttributes.Builder putAttributes(String key, Object value)
Put one entry to theattributesmap.- Parameters:
key- The key in the attributes mapvalue- The associated value in the attributes map- Returns:
thisbuilder for use in a chained invocation
-
putAttributes
@CanIgnoreReturnValue public final ImmutablePageAttributes.Builder putAttributes(Map.Entry<String,? extends Object> entry)
Put one entry to theattributesmap. Nulls are not permitted- Parameters:
entry- The key and value entry- Returns:
thisbuilder for use in a chained invocation
-
attributes
@CanIgnoreReturnValue public final ImmutablePageAttributes.Builder attributes(Map<String,? extends Object> entries)
Sets or replaces all mappings from the specified map as entries for theattributesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the attributes map- Returns:
thisbuilder for use in a chained invocation
-
putAllAttributes
@CanIgnoreReturnValue public final ImmutablePageAttributes.Builder putAllAttributes(Map<String,? extends Object> entries)
Put all mappings from the specified map as entries toattributesmap. Nulls are not permitted- Parameters:
entries- The entries that will be added to the attributes map- Returns:
thisbuilder for use in a chained invocation
-
template
@CanIgnoreReturnValue public final ImmutablePageAttributes.Builder template(String template)
Initializes the value for thetemplateattribute.- Parameters:
template- The value for template- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutablePageAttributes build()
Builds a newImmutablePageAttributes.- Returns:
- An immutable instance of PageAttributes
- Throws:
IllegalStateException- if any required attributes are missing
-
-