Class ImmutablePageAttributes

java.lang.Object
io.dialob.boot.controller.ImmutablePageAttributes
All Implemented Interfaces:
PageAttributes

@Generated(from="PageAttributes", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePageAttributes extends Object implements PageAttributes
Immutable implementation of PageAttributes.

Use the builder to create immutable instances: ImmutablePageAttributes.builder().

  • Method Details

    • getAttributes

      public com.google.common.collect.ImmutableMap<String,Object> getAttributes()
      Specified by:
      getAttributes in interface PageAttributes
      Returns:
      The value of the attributes attribute
    • getTemplate

      public String getTemplate()
      Specified by:
      getTemplate in interface PageAttributes
      Returns:
      The value of the template attribute
    • withAttributes

      public final ImmutablePageAttributes withAttributes(Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the attributes map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to replace the attributes map
      Returns:
      A modified copy or this if not changed
    • withTemplate

      public final ImmutablePageAttributes withTemplate(String value)
      Copy the current immutable object by setting a value for the template attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for template
      Returns:
      A modified copy or the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutablePageAttributes that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: attributes, template.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value PageAttributes with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static ImmutablePageAttributes copyOf(PageAttributes instance)
      Creates an immutable copy of a PageAttributes value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable PageAttributes instance
    • builder

      public static ImmutablePageAttributes.Builder builder()
      Creates a builder for ImmutablePageAttributes.
       ImmutablePageAttributes.builder()
          .putAttributes|putAllAttributes(String => Object) // attributes mappings
          .template(String) // required template
          .build();
       
      Returns:
      A new ImmutablePageAttributes builder