Package io.dialob.client.api
Class ImmutableBodySource
- java.lang.Object
-
- io.dialob.client.api.ImmutableBodySource
-
- All Implemented Interfaces:
DialobStore.BodySource,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableBodySource extends Object implements DialobStore.BodySource
Immutable implementation ofDialobStore.BodySource.Use the builder to create immutable instances:
ImmutableBodySource.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableBodySource.BuilderBuilds instances of typeImmutableBodySource.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableBodySource.Builderbuilder()Creates a builder forImmutableBodySource.static ImmutableBodySourcecopyOf(DialobStore.BodySource instance)Creates an immutable copy of aDialobStore.BodySourcevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableBodySourcethat have equal attribute values.DialobStore.BodyTypegetBodyType()StringgetHash()StringgetId()StringgetValue()inthashCode()Computes a hash code from attributes:id,hash,bodyType,value.StringtoString()Prints the immutable valueBodySourcewith attribute values.ImmutableBodySourcewithBodyType(DialobStore.BodyType value)Copy the current immutable object by setting a value for thebodyTypeattribute.ImmutableBodySourcewithHash(String value)Copy the current immutable object by setting a value for thehashattribute.ImmutableBodySourcewithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableBodySourcewithValue(String value)Copy the current immutable object by setting a value for thevalueattribute.
-
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceDialobStore.BodySource- Returns:
- The value of the
idattribute
-
getHash
public String getHash()
- Specified by:
getHashin interfaceDialobStore.BodySource- Returns:
- The value of the
hashattribute
-
getBodyType
public DialobStore.BodyType getBodyType()
- Specified by:
getBodyTypein interfaceDialobStore.BodySource- Returns:
- The value of the
bodyTypeattribute
-
getValue
public String getValue()
- Specified by:
getValuein interfaceDialobStore.BodySource- Returns:
- The value of the
valueattribute
-
withId
public final ImmutableBodySource 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
-
withHash
public final ImmutableBodySource 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
-
withBodyType
public final ImmutableBodySource 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
-
withValue
public final ImmutableBodySource 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
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableBodySourcethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,hash,bodyType,value.
-
toString
public String toString()
Prints the immutable valueBodySourcewith attribute values.
-
copyOf
public static ImmutableBodySource copyOf(DialobStore.BodySource instance)
Creates an immutable copy of aDialobStore.BodySourcevalue. 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 BodySource instance
-
builder
public static ImmutableBodySource.Builder builder()
Creates a builder forImmutableBodySource.ImmutableBodySource.builder() .id(String) // requiredid.hash(String) // requiredhash.bodyType(io.dialob.client.api.DialobStore.BodyType) // requiredbodyType.value(String) // requiredvalue.build();- Returns:
- A new ImmutableBodySource builder
-
-