Package io.thestencil.staticontent.api
Class ImmutableTopicData
- java.lang.Object
-
- io.thestencil.staticontent.api.ImmutableTopicData
-
- All Implemented Interfaces:
StaticContentClient.TopicData
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableTopicData extends Object implements StaticContentClient.TopicData
Immutable implementation ofStaticContentClient.TopicData.Use the builder to create immutable instances:
ImmutableTopicData.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableTopicData.BuilderBuilds instances of typeImmutableTopicData.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableTopicData.Builderbuilder()Creates a builder forImmutableTopicData.static ImmutableTopicDatacopyOf(StaticContentClient.TopicData instance)Creates an immutable copy of aStaticContentClient.TopicDatavalue.booleanequals(Object another)This instance is equal to all instances ofImmutableTopicDatathat have equal attribute values.com.google.common.collect.ImmutableList<MarkdownContent.Heading>getHeadings()com.google.common.collect.ImmutableList<MarkdownContent.ImageTag>getImages()StringgetLocale()StringgetPath()StringgetValue()inthashCode()Computes a hash code from attributes:path,locale,value,headings,images.StringtoString()Prints the immutable valueTopicDatawith attribute values.ImmutableTopicDatawithHeadings(MarkdownContent.Heading... elements)Copy the current immutable object with elements that replace the content ofheadings.ImmutableTopicDatawithHeadings(Iterable<? extends MarkdownContent.Heading> elements)Copy the current immutable object with elements that replace the content ofheadings.ImmutableTopicDatawithImages(MarkdownContent.ImageTag... elements)Copy the current immutable object with elements that replace the content ofimages.ImmutableTopicDatawithImages(Iterable<? extends MarkdownContent.ImageTag> elements)Copy the current immutable object with elements that replace the content ofimages.ImmutableTopicDatawithLocale(String value)Copy the current immutable object by setting a value for thelocaleattribute.ImmutableTopicDatawithPath(String value)Copy the current immutable object by setting a value for thepathattribute.ImmutableTopicDatawithValue(String value)Copy the current immutable object by setting a value for thevalueattribute.
-
-
-
Method Detail
-
getPath
public String getPath()
- Specified by:
getPathin interfaceStaticContentClient.TopicData- Returns:
- The value of the
pathattribute
-
getLocale
public String getLocale()
- Specified by:
getLocalein interfaceStaticContentClient.TopicData- Returns:
- The value of the
localeattribute
-
getValue
public String getValue()
- Specified by:
getValuein interfaceStaticContentClient.TopicData- Returns:
- The value of the
valueattribute
-
getHeadings
public com.google.common.collect.ImmutableList<MarkdownContent.Heading> getHeadings()
- Specified by:
getHeadingsin interfaceStaticContentClient.TopicData- Returns:
- The value of the
headingsattribute
-
getImages
public com.google.common.collect.ImmutableList<MarkdownContent.ImageTag> getImages()
- Specified by:
getImagesin interfaceStaticContentClient.TopicData- Returns:
- The value of the
imagesattribute
-
withPath
public final ImmutableTopicData withPath(String value)
Copy the current immutable object by setting a value for thepathattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for path- Returns:
- A modified copy of the
thisobject
-
withLocale
public final ImmutableTopicData withLocale(String value)
Copy the current immutable object by setting a value for thelocaleattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for locale- Returns:
- A modified copy of the
thisobject
-
withValue
public final ImmutableTopicData withValue(String value)
Copy the current immutable object by setting a value for thevalueattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value- Returns:
- A modified copy of the
thisobject
-
withHeadings
public final ImmutableTopicData 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 ImmutableTopicData 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
-
withImages
public final ImmutableTopicData 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 ImmutableTopicData 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
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableTopicDatathat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:path,locale,value,headings,images.
-
toString
public String toString()
Prints the immutable valueTopicDatawith attribute values.
-
copyOf
public static ImmutableTopicData copyOf(StaticContentClient.TopicData instance)
Creates an immutable copy of aStaticContentClient.TopicDatavalue. 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 TopicData instance
-
builder
public static ImmutableTopicData.Builder builder()
Creates a builder forImmutableTopicData.ImmutableTopicData.builder() .path(String) // requiredpath.locale(String) // requiredlocale.value(String) // requiredvalue.addHeadings|addAllHeadings(io.thestencil.staticontent.api.MarkdownContent.Heading) //headingselements .addImages|addAllImages(io.thestencil.staticontent.api.MarkdownContent.ImageTag) //imageselements .build();- Returns:
- A new ImmutableTopicData builder
-
-