Package io.thestencil.persistence.api
Class ImmutableLink
- java.lang.Object
-
- io.thestencil.persistence.api.ImmutableLink
-
- All Implemented Interfaces:
ZoePersistence.EntityBody,ZoePersistence.Link,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableLink extends Object implements ZoePersistence.Link
Immutable implementation ofZoePersistence.Link.Use the builder to create immutable instances:
ImmutableLink.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableLink.BuilderBuilds instances of typeImmutableLink.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableLink.Builderbuilder()Creates a builder forImmutableLink.static ImmutableLinkcopyOf(ZoePersistence.Link instance)Creates an immutable copy of aZoePersistence.Linkvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableLinkthat have equal attribute values.com.google.common.collect.ImmutableList<String>getArticles()StringgetContent()StringgetContentType()StringgetDescription()StringgetLocale()inthashCode()Computes a hash code from attributes:articles,locale,content,contentType,description.StringtoString()Prints the immutable valueLinkwith attribute values.ImmutableLinkwithArticles(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofarticles.ImmutableLinkwithArticles(String... elements)Copy the current immutable object with elements that replace the content ofarticles.ImmutableLinkwithContent(String value)Copy the current immutable object by setting a value for thecontentattribute.ImmutableLinkwithContentType(String value)Copy the current immutable object by setting a value for thecontentTypeattribute.ImmutableLinkwithDescription(String value)Copy the current immutable object by setting a value for thedescriptionattribute.ImmutableLinkwithLocale(String value)Copy the current immutable object by setting a value for thelocaleattribute.
-
-
-
Method Detail
-
getArticles
public com.google.common.collect.ImmutableList<String> getArticles()
- Specified by:
getArticlesin interfaceZoePersistence.Link- Returns:
- The value of the
articlesattribute
-
getLocale
public String getLocale()
- Specified by:
getLocalein interfaceZoePersistence.Link- Returns:
- The value of the
localeattribute
-
getContent
public String getContent()
- Specified by:
getContentin interfaceZoePersistence.Link- Returns:
- The value of the
contentattribute
-
getContentType
public String getContentType()
- Specified by:
getContentTypein interfaceZoePersistence.Link- Returns:
- The value of the
contentTypeattribute
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceZoePersistence.Link- Returns:
- The value of the
descriptionattribute
-
withArticles
public final ImmutableLink withArticles(String... elements)
Copy the current immutable object with elements that replace the content ofarticles.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withArticles
public final ImmutableLink withArticles(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofarticles. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of articles elements to set- Returns:
- A modified copy of
thisobject
-
withLocale
public final ImmutableLink 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
-
withContent
public final ImmutableLink withContent(String value)
Copy the current immutable object by setting a value for thecontentattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for content- Returns:
- A modified copy of the
thisobject
-
withContentType
public final ImmutableLink withContentType(String value)
Copy the current immutable object by setting a value for thecontentTypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for contentType- Returns:
- A modified copy of the
thisobject
-
withDescription
public final ImmutableLink withDescription(String value)
Copy the current immutable object by setting a value for thedescriptionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for description- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableLinkthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:articles,locale,content,contentType,description.
-
toString
public String toString()
Prints the immutable valueLinkwith attribute values.
-
copyOf
public static ImmutableLink copyOf(ZoePersistence.Link instance)
Creates an immutable copy of aZoePersistence.Linkvalue. 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 Link instance
-
builder
public static ImmutableLink.Builder builder()
Creates a builder forImmutableLink.ImmutableLink.builder() .addArticles|addAllArticles(String) //articleselements .locale(String) // requiredlocale.content(String) // requiredcontent.contentType(String) // requiredcontentType.description(String) // requireddescription.build();- Returns:
- A new ImmutableLink builder
-
-