Class ImmutableMarkdownAst
- java.lang.Object
-
- io.thestencil.staticontent.spi.visitor.ImmutableMarkdownAst
-
- All Implemented Interfaces:
MarkdownVisitor.MarkdownAst
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableMarkdownAst extends Object implements MarkdownVisitor.MarkdownAst
Immutable implementation ofMarkdownVisitor.MarkdownAst.Use the builder to create immutable instances:
ImmutableMarkdownAst.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableMarkdownAst.BuilderBuilds instances of typeImmutableMarkdownAst.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableMarkdownAst.Builderbuilder()Creates a builder forImmutableMarkdownAst.static ImmutableMarkdownAstcopyOf(MarkdownVisitor.MarkdownAst instance)Creates an immutable copy of aMarkdownVisitor.MarkdownAstvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableMarkdownAstthat have equal attribute values.com.google.common.collect.ImmutableList<MarkdownContent.Heading>getHeadings()com.google.common.collect.ImmutableList<MarkdownContent.ImageTag>getImages()inthashCode()Computes a hash code from attributes:images,headings.StringtoString()Prints the immutable valueMarkdownAstwith attribute values.ImmutableMarkdownAstwithHeadings(MarkdownContent.Heading... elements)Copy the current immutable object with elements that replace the content ofheadings.ImmutableMarkdownAstwithHeadings(Iterable<? extends MarkdownContent.Heading> elements)Copy the current immutable object with elements that replace the content ofheadings.ImmutableMarkdownAstwithImages(MarkdownContent.ImageTag... elements)Copy the current immutable object with elements that replace the content ofimages.ImmutableMarkdownAstwithImages(Iterable<? extends MarkdownContent.ImageTag> elements)Copy the current immutable object with elements that replace the content ofimages.
-
-
-
Method Detail
-
getImages
public com.google.common.collect.ImmutableList<MarkdownContent.ImageTag> getImages()
- Specified by:
getImagesin interfaceMarkdownVisitor.MarkdownAst- Returns:
- The value of the
imagesattribute
-
getHeadings
public com.google.common.collect.ImmutableList<MarkdownContent.Heading> getHeadings()
- Specified by:
getHeadingsin interfaceMarkdownVisitor.MarkdownAst- Returns:
- The value of the
headingsattribute
-
withImages
public final ImmutableMarkdownAst withImages(MarkdownContent.ImageTag... elements)
Copy the current immutable object with elements that replace the content ofimages.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withImages
public final ImmutableMarkdownAst withImages(Iterable<? extends MarkdownContent.ImageTag> elements)
Copy the current immutable object with elements that replace the content ofimages. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of images elements to set- Returns:
- A modified copy of
thisobject
-
withHeadings
public final ImmutableMarkdownAst withHeadings(MarkdownContent.Heading... elements)
Copy the current immutable object with elements that replace the content ofheadings.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withHeadings
public final ImmutableMarkdownAst withHeadings(Iterable<? extends MarkdownContent.Heading> elements)
Copy the current immutable object with elements that replace the content ofheadings. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of headings elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableMarkdownAstthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:images,headings.
-
toString
public String toString()
Prints the immutable valueMarkdownAstwith attribute values.
-
copyOf
public static ImmutableMarkdownAst copyOf(MarkdownVisitor.MarkdownAst instance)
Creates an immutable copy of aMarkdownVisitor.MarkdownAstvalue. 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 forImmutableMarkdownAst.ImmutableMarkdownAst.builder() .addImages|addAllImages(io.thestencil.staticontent.api.MarkdownContent.ImageTag) //imageselements .addHeadings|addAllHeadings(io.thestencil.staticontent.api.MarkdownContent.Heading) //headingselements .build();- Returns:
- A new ImmutableMarkdownAst builder
-
-