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 of
Answer.
Use the builder to create immutable instances:
ImmutableAnswer.builder().
Use the static factory method to create immutable instances:
ImmutableAnswer.of().
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic ImmutableAnswer.Builderbuilder()Creates a builder forImmutableAnswer.static ImmutableAnswerCreates an immutable copy of aAnswervalue.booleanThis instance is equal to all instances ofImmutableAnswerthat have equal attribute values.getId()getType()getValue()Text and number field answers stored in orignal formatinthashCode()Computes a hash code from attributes:id,value,type,acceptedValue,updated,userId.static ImmutableAnswerConstruct a new immutableAnswerinstance.toString()Prints the immutable valueAnswerwith attribute values.final ImmutableAnswerwithAcceptedValue(Object value) Copy the current immutable object by setting a value for theacceptedValueattribute.final ImmutableAnswerCopy the current immutable object by setting a value for theidattribute.final ImmutableAnswerCopy the current immutable object by setting a value for thetypeattribute.final ImmutableAnswerwithUpdated(Date value) Copy the current immutable object by setting a value for theupdatedattribute.final ImmutableAnswerwithUserId(String value) Copy the current immutable object by setting a value for theuserIdattribute.final ImmutableAnswerCopy the current immutable object by setting a value for thevalueattribute.
-
Method Details
-
getId
-
getValue
Text and number field answers stored in orignal format -
getType
-
getAcceptedValue
- Specified by:
getAcceptedValuein interfaceAnswer- Returns:
- The value of the
acceptedValueattribute
-
getUpdated
- Specified by:
getUpdatedin interfaceAnswer- Returns:
- The value of the
updatedattribute
-
getUserId
-
withId
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
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
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
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
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
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
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
Prints the immutable valueAnswerwith attribute values. -
of
Construct a new immutableAnswerinstance.- Parameters:
id- The value for theidattributevalue- The value for thevalueattribute- Returns:
- An immutable Answer instance
-
copyOf
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
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
-