Package io.dialob.api.questionnaire
Class ImmutableAnswer
- java.lang.Object
-
- io.dialob.api.questionnaire.ImmutableAnswer
-
- All Implemented Interfaces:
Answer,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableAnswer extends Object implements Answer
Immutable implementation ofAnswer.Use the builder to create immutable instances:
ImmutableAnswer.builder(). Use the static factory method to create immutable instances:ImmutableAnswer.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableAnswer.BuilderBuilds instances of typeImmutableAnswer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableAnswer.Builderbuilder()Creates a builder forImmutableAnswer.static ImmutableAnswercopyOf(Answer instance)Creates an immutable copy of aAnswervalue.booleanequals(Object another)This instance is equal to all instances ofImmutableAnswerthat have equal attribute values.ObjectgetAcceptedValue()StringgetId()StringgetType()DategetUpdated()StringgetUserId()ObjectgetValue()Text and number field answers stored in orignal formatinthashCode()Computes a hash code from attributes:id,value,type,acceptedValue,updated,userId.static ImmutableAnswerof(String id, Object value)Construct a new immutableAnswerinstance.StringtoString()Prints the immutable valueAnswerwith attribute values.ImmutableAnswerwithAcceptedValue(Object value)Copy the current immutable object by setting a value for theacceptedValueattribute.ImmutableAnswerwithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableAnswerwithType(String value)Copy the current immutable object by setting a value for thetypeattribute.ImmutableAnswerwithUpdated(Date value)Copy the current immutable object by setting a value for theupdatedattribute.ImmutableAnswerwithUserId(String value)Copy the current immutable object by setting a value for theuserIdattribute.ImmutableAnswerwithValue(Object value)Copy the current immutable object by setting a value for thevalueattribute.
-
-
-
Method Detail
-
getId
public String getId()
-
getValue
public Object getValue()
Text and number field answers stored in orignal format
-
getType
public String getType()
-
getAcceptedValue
public Object getAcceptedValue()
- Specified by:
getAcceptedValuein interfaceAnswer- Returns:
- The value of the
acceptedValueattribute
-
getUpdated
public Date getUpdated()
- Specified by:
getUpdatedin interfaceAnswer- Returns:
- The value of the
updatedattribute
-
getUserId
public String getUserId()
-
withId
public final ImmutableAnswer 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 (can benull)- Returns:
- A modified copy of the
thisobject
-
withValue
public final ImmutableAnswer withValue(Object value)
Copy the current immutable object by setting a value for thevalueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for value (can benull)- Returns:
- A modified copy of the
thisobject
-
withType
public final ImmutableAnswer withType(String value)
Copy the current immutable object by setting a value for thetypeattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type (can benull)- Returns:
- A modified copy of the
thisobject
-
withAcceptedValue
public final ImmutableAnswer withAcceptedValue(Object value)
Copy the current immutable object by setting a value for theacceptedValueattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for acceptedValue (can benull)- Returns:
- A modified copy of the
thisobject
-
withUpdated
public final ImmutableAnswer withUpdated(Date value)
Copy the current immutable object by setting a value for theupdatedattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for updated (can benull)- Returns:
- A modified copy of the
thisobject
-
withUserId
public final ImmutableAnswer withUserId(String value)
Copy the current immutable object by setting a value for theuserIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for userId (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableAnswerthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,value,type,acceptedValue,updated,userId.
-
toString
public String toString()
Prints the immutable valueAnswerwith attribute values.
-
of
public static ImmutableAnswer of(String id, Object value)
Construct a new immutableAnswerinstance.- Parameters:
id- The value for theidattributevalue- The value for thevalueattribute- Returns:
- An immutable Answer instance
-
copyOf
public static ImmutableAnswer copyOf(Answer instance)
Creates an immutable copy of aAnswervalue. 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 Answer instance
-
builder
public static ImmutableAnswer.Builder builder()
Creates a builder forImmutableAnswer.ImmutableAnswer.builder() .id(String | null) // nullableid.value(Object | null) // nullablevalue.type(String | null) // nullabletype.acceptedValue(Object | null) // nullableacceptedValue.updated(Date | null) // nullableupdated.userId(String | null) // nullableuserId.build();- Returns:
- A new ImmutableAnswer builder
-
-