Package io.dialob.client.api
Class ImmutableProgramWrapper
- java.lang.Object
-
- io.dialob.client.api.ImmutableProgramWrapper
-
- All Implemented Interfaces:
DialobClient.ProgramWrapper
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableProgramWrapper extends Object implements DialobClient.ProgramWrapper
Immutable implementation ofDialobClient.ProgramWrapper.Use the builder to create immutable instances:
ImmutableProgramWrapper.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableProgramWrapper.BuilderBuilds instances of typeImmutableProgramWrapper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableProgramWrapper.Builderbuilder()Creates a builder forImmutableProgramWrapper.static ImmutableProgramWrappercopyOf(DialobClient.ProgramWrapper instance)Creates an immutable copy of aDialobClient.ProgramWrappervalue.booleanequals(Object another)This instance is equal to all instances ofImmutableProgramWrapperthat have equal attribute values.Optional<io.dialob.api.form.Form>getAst()com.google.common.collect.ImmutableList<DialobClient.ProgramMessage>getErrors()StringgetId()Optional<DialobProgram>getProgram()DialobStore.BodySourcegetSource()DialobClient.ProgramStatusgetStatus()inthashCode()Computes a hash code from attributes:id,status,errors,source,ast,program.StringtoString()Prints the immutable valueProgramWrapperwith attribute values.ImmutableProgramWrapperwithAst(io.dialob.api.form.Form value)Copy the current immutable object by setting a present value for the optionalastattribute.ImmutableProgramWrapperwithAst(Optional<? extends io.dialob.api.form.Form> optional)Copy the current immutable object by setting an optional value for theastattribute.ImmutableProgramWrapperwithErrors(DialobClient.ProgramMessage... elements)Copy the current immutable object with elements that replace the content oferrors.ImmutableProgramWrapperwithErrors(Iterable<? extends DialobClient.ProgramMessage> elements)Copy the current immutable object with elements that replace the content oferrors.ImmutableProgramWrapperwithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableProgramWrapperwithProgram(DialobProgram value)Copy the current immutable object by setting a present value for the optionalprogramattribute.ImmutableProgramWrapperwithProgram(Optional<? extends DialobProgram> optional)Copy the current immutable object by setting an optional value for theprogramattribute.ImmutableProgramWrapperwithSource(DialobStore.BodySource value)Copy the current immutable object by setting a value for thesourceattribute.ImmutableProgramWrapperwithStatus(DialobClient.ProgramStatus value)Copy the current immutable object by setting a value for thestatusattribute.
-
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceDialobClient.ProgramWrapper- Returns:
- The value of the
idattribute
-
getStatus
public DialobClient.ProgramStatus getStatus()
- Specified by:
getStatusin interfaceDialobClient.ProgramWrapper- Returns:
- The value of the
statusattribute
-
getErrors
public com.google.common.collect.ImmutableList<DialobClient.ProgramMessage> getErrors()
- Specified by:
getErrorsin interfaceDialobClient.ProgramWrapper- Returns:
- The value of the
errorsattribute
-
getSource
public DialobStore.BodySource getSource()
- Specified by:
getSourcein interfaceDialobClient.ProgramWrapper- Returns:
- The value of the
sourceattribute
-
getAst
public Optional<io.dialob.api.form.Form> getAst()
- Specified by:
getAstin interfaceDialobClient.ProgramWrapper- Returns:
- The value of the
astattribute
-
getProgram
public Optional<DialobProgram> getProgram()
- Specified by:
getProgramin interfaceDialobClient.ProgramWrapper- Returns:
- The value of the
programattribute
-
withId
public final ImmutableProgramWrapper 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
-
withStatus
public final ImmutableProgramWrapper withStatus(DialobClient.ProgramStatus 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
-
withErrors
public final ImmutableProgramWrapper withErrors(DialobClient.ProgramMessage... 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 ImmutableProgramWrapper withErrors(Iterable<? extends DialobClient.ProgramMessage> 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
-
withSource
public final ImmutableProgramWrapper withSource(DialobStore.BodySource value)
Copy the current immutable object by setting a value for thesourceattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for source- Returns:
- A modified copy of the
thisobject
-
withAst
public final ImmutableProgramWrapper withAst(io.dialob.api.form.Form value)
Copy the current immutable object by setting a present value for the optionalastattribute.- Parameters:
value- The value for ast- Returns:
- A modified copy of
thisobject
-
withAst
public final ImmutableProgramWrapper withAst(Optional<? extends io.dialob.api.form.Form> optional)
Copy the current immutable object by setting an optional value for theastattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for ast- Returns:
- A modified copy of
thisobject
-
withProgram
public final ImmutableProgramWrapper withProgram(DialobProgram value)
Copy the current immutable object by setting a present value for the optionalprogramattribute.- Parameters:
value- The value for program- Returns:
- A modified copy of
thisobject
-
withProgram
public final ImmutableProgramWrapper withProgram(Optional<? extends DialobProgram> optional)
Copy the current immutable object by setting an optional value for theprogramattribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returningthis.- Parameters:
optional- A value for program- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableProgramWrapperthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,status,errors,source,ast,program.
-
toString
public String toString()
Prints the immutable valueProgramWrapperwith attribute values.
-
copyOf
public static ImmutableProgramWrapper copyOf(DialobClient.ProgramWrapper instance)
Creates an immutable copy of aDialobClient.ProgramWrappervalue. 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 ProgramWrapper instance
-
builder
public static ImmutableProgramWrapper.Builder builder()
Creates a builder forImmutableProgramWrapper.ImmutableProgramWrapper.builder() .id(String) // requiredid.status(io.dialob.client.api.DialobClient.ProgramStatus) // requiredstatus.addErrors|addAllErrors(io.dialob.client.api.DialobClient.ProgramMessage) //errorselements .source(io.dialob.client.api.DialobStore.BodySource) // requiredsource.ast(io.dialob.api.form.Form) // optionalast.program(io.dialob.program.DialobProgram) // optionalprogram.build();- Returns:
- A new ImmutableProgramWrapper builder
-
-