Package io.dialob.client.api
Class ImmutableComposerEntity<A>
- java.lang.Object
-
- io.dialob.client.api.ImmutableComposerEntity<A>
-
- All Implemented Interfaces:
DialobComposer.ComposerEntity<A>
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableComposerEntity<A> extends Object implements DialobComposer.ComposerEntity<A>
Immutable implementation ofDialobComposer.ComposerEntity.Use the builder to create immutable instances:
ImmutableComposerEntity.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableComposerEntity.Builder<A>Builds instances of typeImmutableComposerEntity.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <A> ImmutableComposerEntity.Builder<A>builder()Creates a builder forImmutableComposerEntity.static <A> ImmutableComposerEntity<A>copyOf(DialobComposer.ComposerEntity<A> instance)Creates an immutable copy of aDialobComposer.ComposerEntityvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableComposerEntitythat have equal attribute values.AgetBody()com.google.common.collect.ImmutableList<io.dialob.api.rest.Response>getErrors()StringgetId()DialobStore.BodyStatusgetStatus()inthashCode()Computes a hash code from attributes:id,body,errors,status.StringtoString()Prints the immutable valueComposerEntitywith attribute values.ImmutableComposerEntity<A>withBody(A value)Copy the current immutable object by setting a value for thebodyattribute.ImmutableComposerEntity<A>withErrors(io.dialob.api.rest.Response... elements)Copy the current immutable object with elements that replace the content oferrors.ImmutableComposerEntity<A>withErrors(Iterable<? extends io.dialob.api.rest.Response> elements)Copy the current immutable object with elements that replace the content oferrors.ImmutableComposerEntity<A>withId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableComposerEntity<A>withStatus(DialobStore.BodyStatus value)Copy the current immutable object by setting a value for thestatusattribute.
-
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceDialobComposer.ComposerEntity<A>- Returns:
- The value of the
idattribute
-
getBody
public A getBody()
- Specified by:
getBodyin interfaceDialobComposer.ComposerEntity<A>- Returns:
- The value of the
bodyattribute
-
getErrors
public com.google.common.collect.ImmutableList<io.dialob.api.rest.Response> getErrors()
- Specified by:
getErrorsin interfaceDialobComposer.ComposerEntity<A>- Returns:
- The value of the
errorsattribute
-
getStatus
public DialobStore.BodyStatus getStatus()
- Specified by:
getStatusin interfaceDialobComposer.ComposerEntity<A>- Returns:
- The value of the
statusattribute
-
withId
public final ImmutableComposerEntity<A> 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
-
withBody
public final ImmutableComposerEntity<A> withBody(A value)
Copy the current immutable object by setting a value for thebodyattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for body- Returns:
- A modified copy of the
thisobject
-
withErrors
public final ImmutableComposerEntity<A> withErrors(io.dialob.api.rest.Response... elements)
Copy the current immutable object with elements that replace the content oferrors.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withErrors
public final ImmutableComposerEntity<A> withErrors(Iterable<? extends io.dialob.api.rest.Response> elements)
Copy the current immutable object with elements that replace the content oferrors. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of errors elements to set- Returns:
- A modified copy of
thisobject
-
withStatus
public final ImmutableComposerEntity<A> withStatus(DialobStore.BodyStatus value)
Copy the current immutable object by setting a value for thestatusattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for status- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableComposerEntitythat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,body,errors,status.
-
toString
public String toString()
Prints the immutable valueComposerEntitywith attribute values.
-
copyOf
public static <A> ImmutableComposerEntity<A> copyOf(DialobComposer.ComposerEntity<A> instance)
Creates an immutable copy of aDialobComposer.ComposerEntityvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Type Parameters:
A- generic parameter A- Parameters:
instance- The instance to copy- Returns:
- A copied immutable ComposerEntity instance
-
builder
public static <A> ImmutableComposerEntity.Builder<A> builder()
Creates a builder forImmutableComposerEntity.ImmutableComposerEntity.<A>builder() .id(String) // requiredid.body(A) // requiredbody.addErrors|addAllErrors(io.dialob.api.rest.Response) //errorselements .status(io.dialob.client.api.DialobStore.BodyStatus) // requiredstatus.build();- Type Parameters:
A- generic parameter A- Returns:
- A new ImmutableComposerEntity builder
-
-