Package io.dialob.client.api
Class ImmutableStoreEntity
- java.lang.Object
-
- io.dialob.client.api.ImmutableStoreEntity
-
- All Implemented Interfaces:
DialobStore.StoreEntity,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableStoreEntity extends Object implements DialobStore.StoreEntity
Immutable implementation ofDialobStore.StoreEntity.Use the builder to create immutable instances:
ImmutableStoreEntity.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableStoreEntity.BuilderBuilds instances of typeImmutableStoreEntity.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableStoreEntity.Builderbuilder()Creates a builder forImmutableStoreEntity.static ImmutableStoreEntitycopyOf(DialobStore.StoreEntity instance)Creates an immutable copy of aDialobStore.StoreEntityvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableStoreEntitythat have equal attribute values.StringgetBody()DialobDocument.DocumentTypegetBodyType()StringgetId()StringgetVersion()inthashCode()Computes a hash code from attributes:id,version,bodyType,body.StringtoString()Prints the immutable valueStoreEntitywith attribute values.ImmutableStoreEntitywithBody(String value)Copy the current immutable object by setting a value for thebodyattribute.ImmutableStoreEntitywithBodyType(DialobDocument.DocumentType value)Copy the current immutable object by setting a value for thebodyTypeattribute.ImmutableStoreEntitywithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableStoreEntitywithVersion(String value)Copy the current immutable object by setting a value for theversionattribute.
-
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceDialobStore.StoreEntity- Returns:
- The value of the
idattribute
-
getVersion
public String getVersion()
- Specified by:
getVersionin interfaceDialobStore.StoreEntity- Returns:
- The value of the
versionattribute
-
getBodyType
public DialobDocument.DocumentType getBodyType()
- Specified by:
getBodyTypein interfaceDialobStore.StoreEntity- Returns:
- The value of the
bodyTypeattribute
-
getBody
public String getBody()
- Specified by:
getBodyin interfaceDialobStore.StoreEntity- Returns:
- The value of the
bodyattribute
-
withId
public final ImmutableStoreEntity withId(String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withVersion
public final ImmutableStoreEntity withVersion(String value)
Copy the current immutable object by setting a value for theversionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for version- Returns:
- A modified copy of the
thisobject
-
withBodyType
public final ImmutableStoreEntity withBodyType(DialobDocument.DocumentType value)
Copy the current immutable object by setting a value for thebodyTypeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for bodyType- Returns:
- A modified copy of the
thisobject
-
withBody
public final ImmutableStoreEntity withBody(String value)
Copy the current immutable object by setting a value for thebodyattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for body- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableStoreEntitythat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,version,bodyType,body.
-
toString
public String toString()
Prints the immutable valueStoreEntitywith attribute values.
-
copyOf
public static ImmutableStoreEntity copyOf(DialobStore.StoreEntity instance)
Creates an immutable copy of aDialobStore.StoreEntityvalue. 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 StoreEntity instance
-
builder
public static ImmutableStoreEntity.Builder builder()
Creates a builder forImmutableStoreEntity.ImmutableStoreEntity.builder() .id(String) // requiredid.version(String) // requiredversion.bodyType(io.dialob.client.api.DialobDocument.DocumentType) // requiredbodyType.body(String) // requiredbody.build();- Returns:
- A new ImmutableStoreEntity builder
-
-