Package io.dialob.api.questionnaire
Class ModifiableAnswer
- java.lang.Object
-
- io.dialob.api.questionnaire.ModifiableAnswer
-
- All Implemented Interfaces:
Answer,Serializable
@ParametersAreNonnullByDefault @Generated({"Modifiables.generator","Answer"}) @NotThreadSafe public final class ModifiableAnswer extends Object implements Answer
A modifiable implementation of theAnswertype.Use the
create()static factory methods to create new instances. Use thetoImmutable()method to convert to canonical immutable instances.ModifiableAnswer is not thread-safe
- See Also:
ImmutableAnswer, Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ModifiableAnswerclear()Clears the object by setting all attributes to their initial values.static ModifiableAnswercreate()Construct a modifiable instance ofAnswer.static ModifiableAnswercreate(String id, Object value)Construct a modifiable instance ofAnswer.booleanequals(Object another)This instance is equal to all instances ofModifiableAnswerthat have equal attribute values.ModifiableAnswerfrom(Answer instance)Fill this modifiable instance with attribute values from the providedAnswerinstance.ModifiableAnswerfrom(ModifiableAnswer instance)Fill this modifiable instance with attribute values from the providedAnswerinstance.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.booleanisInitialized()Returnstrueif all required attributes are set, indicating that the object is initialized.ModifiableAnswersetAcceptedValue(Object acceptedValue)Assigns a value to theacceptedValueattribute.ModifiableAnswersetId(String id)Assigns a value to theidattribute.ModifiableAnswersetType(String type)Assigns a value to thetypeattribute.ModifiableAnswersetUpdated(Date updated)Assigns a value to theupdatedattribute.ModifiableAnswersetUserId(String userId)Assigns a value to theuserIdattribute.ModifiableAnswersetValue(Object value)Assigns a value to thevalueattribute.ImmutableAnswertoImmutable()Converts toImmutableAnswer.StringtoString()Generates a string representation of thisAnswer.
-
-
-
Method Detail
-
create
public static ModifiableAnswer create(String id, Object value)
Construct a modifiable instance ofAnswer.
-
create
public static ModifiableAnswer create()
Construct a modifiable instance ofAnswer.- Returns:
- A new modifiable instance
-
getId
public final String getId()
-
getValue
public final Object getValue()
Text and number field answers stored in orignal format
-
getType
public final String getType()
-
getAcceptedValue
public final Object getAcceptedValue()
- Specified by:
getAcceptedValuein interfaceAnswer- Returns:
- value of
acceptedValueattribute, may benull
-
getUpdated
public final Date getUpdated()
- Specified by:
getUpdatedin interfaceAnswer- Returns:
- value of
updatedattribute, may benull
-
getUserId
public final String getUserId()
-
clear
public ModifiableAnswer clear()
Clears the object by setting all attributes to their initial values.- Returns:
thisfor use in a chained invocation
-
from
public ModifiableAnswer from(Answer instance)
Fill this modifiable instance with attribute values from the providedAnswerinstance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values).- Parameters:
instance- The instance from which to copy values- Returns:
thisfor use in a chained invocation
-
from
public ModifiableAnswer from(ModifiableAnswer instance)
Fill this modifiable instance with attribute values from the providedAnswerinstance. Regular attribute values will be overridden, i.e. replaced with ones of an instance. Any of the instance's absent optional values will not be copied (will not override current values).- Parameters:
instance- The instance from which to copy values- Returns:
thisfor use in a chained invocation
-
setId
public ModifiableAnswer setId(String id)
Assigns a value to theidattribute.- Parameters:
id- The value for id, can benull- Returns:
thisfor use in a chained invocation
-
setValue
public ModifiableAnswer setValue(Object value)
Assigns a value to thevalueattribute.- Parameters:
value- The value for value, can benull- Returns:
thisfor use in a chained invocation
-
setType
public ModifiableAnswer setType(String type)
Assigns a value to thetypeattribute.- Parameters:
type- The value for type, can benull- Returns:
thisfor use in a chained invocation
-
setAcceptedValue
public ModifiableAnswer setAcceptedValue(Object acceptedValue)
Assigns a value to theacceptedValueattribute.- Parameters:
acceptedValue- The value for acceptedValue, can benull- Returns:
thisfor use in a chained invocation
-
setUpdated
public ModifiableAnswer setUpdated(Date updated)
Assigns a value to theupdatedattribute.- Parameters:
updated- The value for updated, can benull- Returns:
thisfor use in a chained invocation
-
setUserId
public ModifiableAnswer setUserId(String userId)
Assigns a value to theuserIdattribute.- Parameters:
userId- The value for userId, can benull- Returns:
thisfor use in a chained invocation
-
isInitialized
public final boolean isInitialized()
Returnstrueif all required attributes are set, indicating that the object is initialized.- Returns:
trueif set
-
toImmutable
public final ImmutableAnswer toImmutable()
Converts toImmutableAnswer.- Returns:
- An immutable instance of Answer
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofModifiableAnswerthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,value,type,acceptedValue,updated,userId.
-
-