Class ImmutableMarkdownContent

  • All Implemented Interfaces:
    MarkdownContent

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableMarkdownContent
    extends Object
    implements MarkdownContent
    Immutable implementation of MarkdownContent.

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

    • Method Detail

      • getLocales

        public com.google.common.collect.ImmutableList<String> getLocales()
        Specified by:
        getLocales in interface MarkdownContent
        Returns:
        The value of the locales attribute
      • withValues

        public final ImmutableMarkdownContent withValues​(MarkdownContent.Markdown... elements)
        Copy the current immutable object with elements that replace the content of values.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withValues

        public final ImmutableMarkdownContent withValues​(Iterable<? extends MarkdownContent.Markdown> elements)
        Copy the current immutable object with elements that replace the content of values. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of values elements to set
        Returns:
        A modified copy of this object
      • withImages

        public final ImmutableMarkdownContent withImages​(Iterable<? extends MarkdownContent.ImageResource> elements)
        Copy the current immutable object with elements that replace the content of images. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of images elements to set
        Returns:
        A modified copy of this object
      • withLinks

        public final ImmutableMarkdownContent withLinks​(Iterable<? extends MarkdownContent.LinkResource> elements)
        Copy the current immutable object with elements that replace the content of links. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of links elements to set
        Returns:
        A modified copy of this object
      • withLocales

        public final ImmutableMarkdownContent withLocales​(String... elements)
        Copy the current immutable object with elements that replace the content of locales.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withLocales

        public final ImmutableMarkdownContent withLocales​(Iterable<String> elements)
        Copy the current immutable object with elements that replace the content of locales. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of locales elements to set
        Returns:
        A modified copy of this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableMarkdownContent 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: values, images, links, locales.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableMarkdownContent copyOf​(MarkdownContent instance)
        Creates an immutable copy of a MarkdownContent 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 MarkdownContent instance
      • builder

        public static ImmutableMarkdownContent.Builder builder()
        Creates a builder for ImmutableMarkdownContent.
         ImmutableMarkdownContent.builder()
            .addValues|addAllValues(io.thestencil.staticontent.api.MarkdownContent.Markdown) // values elements
            .addImages|addAllImages(io.thestencil.staticontent.api.MarkdownContent.ImageResource) // images elements
            .addLinks|addAllLinks(io.thestencil.staticontent.api.MarkdownContent.LinkResource) // links elements
            .addLocales|addAllLocales(String) // locales elements
            .build();
         
        Returns:
        A new ImmutableMarkdownContent builder