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 the
Answer type.
Use the create() static factory methods to create new instances.
Use the toImmutable() method to convert to canonical immutable instances.
ModifiableAnswer is not thread-safe
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionclear()Clears the object by setting all attributes to their initial values.static ModifiableAnswercreate()Construct a modifiable instance ofAnswer.static ModifiableAnswerConstruct a modifiable instance ofAnswer.booleanThis instance is equal to all instances ofModifiableAnswerthat have equal attribute values.Fill this modifiable instance with attribute values from the providedAnswerinstance.from(ModifiableAnswer instance) Fill this modifiable instance with attribute values from the providedAnswerinstance.final Objectfinal StringgetId()final StringgetType()final Datefinal Stringfinal ObjectgetValue()Text and number field answers stored in orignal formatinthashCode()Computes a hash code from attributes:id,value,type,acceptedValue,updated,userId.final booleanReturnstrueif all required attributes are set, indicating that the object is initialized.setAcceptedValue(Object acceptedValue) Assigns a value to theacceptedValueattribute.Assigns a value to theidattribute.Assigns a value to thetypeattribute.setUpdated(Date updated) Assigns a value to theupdatedattribute.Assigns a value to theuserIdattribute.Assigns a value to thevalueattribute.final ImmutableAnswerConverts toImmutableAnswer.toString()Generates a string representation of thisAnswer.
-
Method Details
-
create
Construct a modifiable instance ofAnswer. -
create
Construct a modifiable instance ofAnswer.- Returns:
- A new modifiable instance
-
getId
-
getValue
Text and number field answers stored in orignal format -
getType
-
getAcceptedValue
- Specified by:
getAcceptedValuein interfaceAnswer- Returns:
- value of
acceptedValueattribute, may benull
-
getUpdated
- Specified by:
getUpdatedin interfaceAnswer- Returns:
- value of
updatedattribute, may benull
-
getUserId
-
clear
Clears the object by setting all attributes to their initial values.- Returns:
thisfor use in a chained invocation
-
from
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
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
Assigns a value to theidattribute.- Parameters:
id- The value for id, can benull- Returns:
thisfor use in a chained invocation
-
setValue
Assigns a value to thevalueattribute.- Parameters:
value- The value for value, can benull- Returns:
thisfor use in a chained invocation
-
setType
Assigns a value to thetypeattribute.- Parameters:
type- The value for type, can benull- Returns:
thisfor use in a chained invocation
-
setAcceptedValue
Assigns a value to theacceptedValueattribute.- Parameters:
acceptedValue- The value for acceptedValue, can benull- Returns:
thisfor use in a chained invocation
-
setUpdated
Assigns a value to theupdatedattribute.- Parameters:
updated- The value for updated, can benull- Returns:
thisfor use in a chained invocation
-
setUserId
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
Converts toImmutableAnswer.- Returns:
- An immutable instance of Answer
-
equals
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. -
toString
Generates a string representation of thisAnswer. If uninitialized, some attribute values may appear as question marks.
-