Package io.thestencil.persistence.api
Class ImmutableArticle
- java.lang.Object
-
- io.thestencil.persistence.api.ImmutableArticle
-
- All Implemented Interfaces:
ZoePersistence.Article,ZoePersistence.EntityBody,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableArticle extends Object implements ZoePersistence.Article
Immutable implementation ofZoePersistence.Article.Use the builder to create immutable instances:
ImmutableArticle.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableArticle.BuilderBuilds instances of typeImmutableArticle.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableArticle.Builderbuilder()Creates a builder forImmutableArticle.static ImmutableArticlecopyOf(ZoePersistence.Article instance)Creates an immutable copy of aZoePersistence.Articlevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableArticlethat have equal attribute values.StringgetName()IntegergetOrder()StringgetParentId()inthashCode()Computes a hash code from attributes:parentId,name,order.StringtoString()Prints the immutable valueArticlewith attribute values.ImmutableArticlewithName(String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableArticlewithOrder(Integer value)Copy the current immutable object by setting a value for theorderattribute.ImmutableArticlewithParentId(String value)Copy the current immutable object by setting a value for theparentIdattribute.
-
-
-
Method Detail
-
getParentId
@Nullable public String getParentId()
- Specified by:
getParentIdin interfaceZoePersistence.Article- Returns:
- The value of the
parentIdattribute
-
getName
public String getName()
- Specified by:
getNamein interfaceZoePersistence.Article- Returns:
- The value of the
nameattribute
-
getOrder
public Integer getOrder()
- Specified by:
getOrderin interfaceZoePersistence.Article- Returns:
- The value of the
orderattribute
-
withParentId
public final ImmutableArticle withParentId(@Nullable String value)
Copy the current immutable object by setting a value for theparentIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for parentId (can benull)- Returns:
- A modified copy of the
thisobject
-
withName
public final ImmutableArticle withName(String value)
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
withOrder
public final ImmutableArticle withOrder(Integer value)
Copy the current immutable object by setting a value for theorderattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for order- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableArticlethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:parentId,name,order.
-
toString
public String toString()
Prints the immutable valueArticlewith attribute values.
-
copyOf
public static ImmutableArticle copyOf(ZoePersistence.Article instance)
Creates an immutable copy of aZoePersistence.Articlevalue. 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 Article instance
-
builder
public static ImmutableArticle.Builder builder()
Creates a builder forImmutableArticle.ImmutableArticle.builder() .parentId(String | null) // nullableparentId.name(String) // requiredname.order(Integer) // requiredorder.build();- Returns:
- A new ImmutableArticle builder
-
-