Package io.thestencil.staticontent.api
Class ImmutableMarkdownContent
- java.lang.Object
-
- io.thestencil.staticontent.api.ImmutableMarkdownContent
-
- All Implemented Interfaces:
MarkdownContent
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableMarkdownContent extends Object implements MarkdownContent
Immutable implementation ofMarkdownContent.Use the builder to create immutable instances:
ImmutableMarkdownContent.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableMarkdownContent.BuilderBuilds instances of typeImmutableMarkdownContent.-
Nested classes/interfaces inherited from interface io.thestencil.staticontent.api.MarkdownContent
MarkdownContent.Heading, MarkdownContent.ImageResource, MarkdownContent.ImageTag, MarkdownContent.LinkResource, MarkdownContent.Markdown
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableMarkdownContent.Builderbuilder()Creates a builder forImmutableMarkdownContent.static ImmutableMarkdownContentcopyOf(MarkdownContent instance)Creates an immutable copy of aMarkdownContentvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableMarkdownContentthat have equal attribute values.com.google.common.collect.ImmutableList<MarkdownContent.ImageResource>getImages()com.google.common.collect.ImmutableList<MarkdownContent.LinkResource>getLinks()com.google.common.collect.ImmutableList<String>getLocales()com.google.common.collect.ImmutableList<MarkdownContent.Markdown>getValues()inthashCode()Computes a hash code from attributes:values,images,links,locales.StringtoString()Prints the immutable valueMarkdownContentwith attribute values.ImmutableMarkdownContentwithImages(MarkdownContent.ImageResource... elements)Copy the current immutable object with elements that replace the content ofimages.ImmutableMarkdownContentwithImages(Iterable<? extends MarkdownContent.ImageResource> elements)Copy the current immutable object with elements that replace the content ofimages.ImmutableMarkdownContentwithLinks(MarkdownContent.LinkResource... elements)Copy the current immutable object with elements that replace the content oflinks.ImmutableMarkdownContentwithLinks(Iterable<? extends MarkdownContent.LinkResource> elements)Copy the current immutable object with elements that replace the content oflinks.ImmutableMarkdownContentwithLocales(Iterable<String> elements)Copy the current immutable object with elements that replace the content oflocales.ImmutableMarkdownContentwithLocales(String... elements)Copy the current immutable object with elements that replace the content oflocales.ImmutableMarkdownContentwithValues(MarkdownContent.Markdown... elements)Copy the current immutable object with elements that replace the content ofvalues.ImmutableMarkdownContentwithValues(Iterable<? extends MarkdownContent.Markdown> elements)Copy the current immutable object with elements that replace the content ofvalues.
-
-
-
Method Detail
-
getValues
public com.google.common.collect.ImmutableList<MarkdownContent.Markdown> getValues()
- Specified by:
getValuesin interfaceMarkdownContent- Returns:
- The value of the
valuesattribute
-
getImages
public com.google.common.collect.ImmutableList<MarkdownContent.ImageResource> getImages()
- Specified by:
getImagesin interfaceMarkdownContent- Returns:
- The value of the
imagesattribute
-
getLinks
public com.google.common.collect.ImmutableList<MarkdownContent.LinkResource> getLinks()
- Specified by:
getLinksin interfaceMarkdownContent- Returns:
- The value of the
linksattribute
-
getLocales
public com.google.common.collect.ImmutableList<String> getLocales()
- Specified by:
getLocalesin interfaceMarkdownContent- Returns:
- The value of the
localesattribute
-
withValues
public final ImmutableMarkdownContent withValues(MarkdownContent.Markdown... elements)
Copy the current immutable object with elements that replace the content ofvalues.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withValues
public final ImmutableMarkdownContent withValues(Iterable<? extends MarkdownContent.Markdown> elements)
Copy the current immutable object with elements that replace the content ofvalues. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of values elements to set- Returns:
- A modified copy of
thisobject
-
withImages
public final ImmutableMarkdownContent withImages(MarkdownContent.ImageResource... 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 ImmutableMarkdownContent withImages(Iterable<? extends MarkdownContent.ImageResource> 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
-
withLinks
public final ImmutableMarkdownContent withLinks(MarkdownContent.LinkResource... elements)
Copy the current immutable object with elements that replace the content oflinks.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withLinks
public final ImmutableMarkdownContent withLinks(Iterable<? extends MarkdownContent.LinkResource> elements)
Copy the current immutable object with elements that replace the content oflinks. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of links elements to set- Returns:
- A modified copy of
thisobject
-
withLocales
public final ImmutableMarkdownContent withLocales(String... elements)
Copy the current immutable object with elements that replace the content oflocales.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withLocales
public final ImmutableMarkdownContent withLocales(Iterable<String> elements)
Copy the current immutable object with elements that replace the content oflocales. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of locales elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableMarkdownContentthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:values,images,links,locales.
-
toString
public String toString()
Prints the immutable valueMarkdownContentwith attribute values.
-
copyOf
public static ImmutableMarkdownContent copyOf(MarkdownContent instance)
Creates an immutable copy of aMarkdownContentvalue. 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 forImmutableMarkdownContent.ImmutableMarkdownContent.builder() .addValues|addAllValues(io.thestencil.staticontent.api.MarkdownContent.Markdown) //valueselements .addImages|addAllImages(io.thestencil.staticontent.api.MarkdownContent.ImageResource) //imageselements .addLinks|addAllLinks(io.thestencil.staticontent.api.MarkdownContent.LinkResource) //linkselements .addLocales|addAllLocales(String) //localeselements .build();- Returns:
- A new ImmutableMarkdownContent builder
-
-