Class ImmutablePageAttributes.Builder

java.lang.Object
io.dialob.boot.controller.ImmutablePageAttributes.Builder
Enclosing class:
ImmutablePageAttributes

@Generated(from="PageAttributes", generator="Immutables") @NotThreadSafe public static final class ImmutablePageAttributes.Builder extends Object
Builds instances of type ImmutablePageAttributes. Initialize attributes and then invoke the build() method to create an immutable instance.

Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

  • Method Details

    • from

      @CanIgnoreReturnValue public final ImmutablePageAttributes.Builder from(PageAttributes instance)
      Fill a builder with attribute values from the provided PageAttributes instance. 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:
      this builder for use in a chained invocation
    • putAttributes

      @CanIgnoreReturnValue public final ImmutablePageAttributes.Builder putAttributes(String key, Object value)
      Put one entry to the attributes map.
      Parameters:
      key - The key in the attributes map
      value - The associated value in the attributes map
      Returns:
      this builder for use in a chained invocation
    • putAttributes

      @CanIgnoreReturnValue public final ImmutablePageAttributes.Builder putAttributes(Map.Entry<String,? extends Object> entry)
      Put one entry to the attributes map. Nulls are not permitted
      Parameters:
      entry - The key and value entry
      Returns:
      this builder 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 the attributes map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the attributes map
      Returns:
      this builder 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 to attributes map. Nulls are not permitted
      Parameters:
      entries - The entries that will be added to the attributes map
      Returns:
      this builder for use in a chained invocation
    • template

      @CanIgnoreReturnValue public final ImmutablePageAttributes.Builder template(String template)
      Initializes the value for the template attribute.
      Parameters:
      template - The value for template
      Returns:
      this builder for use in a chained invocation
    • build

      public ImmutablePageAttributes build()
      Returns:
      An immutable instance of PageAttributes
      Throws:
      IllegalStateException - if any required attributes are missing