Class ImmutableTemplate


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableTemplate
    extends Template
    Immutable implementation of Template.

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

    • Method Summary

      Modifier and Type Method Description
      static ImmutableTemplate.Builder builder()
      Creates a builder for ImmutableTemplate.
      static ImmutableTemplate copyOf​(Template instance)
      Creates an immutable copy of a Template value.
      boolean equals​(java.lang.Object another)
      This instance is equal to all instances of ImmutableTemplate that have equal attribute values.
      java.util.Optional<java.lang.String> getRegExp()  
      java.lang.String getType()  
      int hashCode()
      Computes a hash code from attributes: type, regExp.
      java.lang.String toString()
      Prints the immutable value Template with attribute values.
      ImmutableTemplate withRegExp​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional regExp attribute.
      ImmutableTemplate withRegExp​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the regExp attribute.
      ImmutableTemplate withType​(java.lang.String value)
      Copy the current immutable object by setting a value for the type attribute.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getType

        public java.lang.String getType()
        Specified by:
        getType in class Template
        Returns:
        The value of the type attribute
      • getRegExp

        public java.util.Optional<java.lang.String> getRegExp()
        Specified by:
        getRegExp in class Template
        Returns:
        The value of the regExp attribute
      • withType

        public final ImmutableTemplate withType​(java.lang.String value)
        Copy the current immutable object by setting a value for the type attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for type
        Returns:
        A modified copy of the this object
      • withRegExp

        public final ImmutableTemplate withRegExp​(java.lang.String value)
        Copy the current immutable object by setting a present value for the optional regExp attribute.
        Parameters:
        value - The value for regExp
        Returns:
        A modified copy of this object
      • withRegExp

        public final ImmutableTemplate withRegExp​(java.util.Optional<java.lang.String> optional)
        Copy the current immutable object by setting an optional value for the regExp attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for regExp
        Returns:
        A modified copy of this object
      • equals

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

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

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

        public static ImmutableTemplate copyOf​(Template instance)
        Creates an immutable copy of a Template 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 Template instance