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()DialobStore.BodyTypegetBodyType()StringgetHash()StringgetId()inthashCode()Computes a hash code from attributes:id,bodyType,hash,body.StringtoString()Prints the immutable valueStoreEntitywith attribute values.ImmutableStoreEntitywithBody(String value)Copy the current immutable object by setting a value for thebodyattribute.ImmutableStoreEntitywithBodyType(DialobStore.BodyType value)Copy the current immutable object by setting a value for thebodyTypeattribute.ImmutableStoreEntitywithHash(String value)Copy the current immutable object by setting a value for thehashattribute.ImmutableStoreEntitywithId(String value)Copy the current immutable object by setting a value for theidattribute.
-
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceDialobStore.StoreEntity- Returns:
- The value of the
idattribute
-
getBodyType
public DialobStore.BodyType getBodyType()
- Specified by:
getBodyTypein interfaceDialobStore.StoreEntity- Returns:
- The value of the
bodyTypeattribute
-
getHash
public String getHash()
- Specified by:
getHashin interfaceDialobStore.StoreEntity- Returns:
- The value of the
hashattribute
-
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
-
withBodyType
public final ImmutableStoreEntity withBodyType(DialobStore.BodyType 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
-
withHash
public final ImmutableStoreEntity withHash(String value)
Copy the current immutable object by setting a value for thehashattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for hash- 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,bodyType,hash,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.bodyType(io.dialob.client.api.DialobStore.BodyType) // requiredbodyType.hash(String) // requiredhash.body(String) // requiredbody.build();- Returns:
- A new ImmutableStoreEntity builder
-
-