Class ImmutableMarkdownAst

    • Method Detail

      • withImages

        public final ImmutableMarkdownAst withImages​(MarkdownContent.ImageTag... elements)
        Copy the current immutable object with elements that replace the content of images.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withImages

        public final ImmutableMarkdownAst withImages​(Iterable<? extends MarkdownContent.ImageTag> 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
      • withHeadings

        public final ImmutableMarkdownAst withHeadings​(MarkdownContent.Heading... elements)
        Copy the current immutable object with elements that replace the content of headings.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withHeadings

        public final ImmutableMarkdownAst withHeadings​(Iterable<? extends MarkdownContent.Heading> elements)
        Copy the current immutable object with elements that replace the content of headings. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of headings 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 ImmutableMarkdownAst 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: images, headings.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableMarkdownAst copyOf​(MarkdownVisitor.MarkdownAst instance)
        Creates an immutable copy of a MarkdownVisitor.MarkdownAst 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 MarkdownAst instance
      • builder

        public static ImmutableMarkdownAst.Builder builder()
        Creates a builder for ImmutableMarkdownAst.
         ImmutableMarkdownAst.builder()
            .addImages|addAllImages(io.thestencil.staticontent.api.MarkdownContent.ImageTag) // images elements
            .addHeadings|addAllHeadings(io.thestencil.staticontent.api.MarkdownContent.Heading) // headings elements
            .build();
         
        Returns:
        A new ImmutableMarkdownAst builder