Class ImmutableMetadataRow
- java.lang.Object
-
- io.dialob.questionnaire.service.api.ImmutableMetadataRow
-
- All Implemented Interfaces:
QuestionnaireDatabase.MetadataRow,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableMetadataRow extends Object implements QuestionnaireDatabase.MetadataRow
Immutable implementation ofQuestionnaireDatabase.MetadataRow.Use the builder to create immutable instances:
ImmutableMetadataRow.builder(). Use the static factory method to create immutable instances:ImmutableMetadataRow.of().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableMetadataRow.BuilderBuilds instances of typeImmutableMetadataRow.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableMetadataRow.Builderbuilder()Creates a builder forImmutableMetadataRow.static ImmutableMetadataRowcopyOf(QuestionnaireDatabase.MetadataRow instance)Creates an immutable copy of aQuestionnaireDatabase.MetadataRowvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableMetadataRowthat have equal attribute values.StringgetId()io.dialob.api.questionnaire.Questionnaire.MetadatagetValue()inthashCode()Computes a hash code from attributes:id,value.static ImmutableMetadataRowof(String id, io.dialob.api.questionnaire.Questionnaire.Metadata value)Construct a new immutableMetadataRowinstance.StringtoString()Prints the immutable valueMetadataRowwith attribute values.ImmutableMetadataRowwithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableMetadataRowwithValue(io.dialob.api.questionnaire.Questionnaire.Metadata value)Copy the current immutable object by setting a value for thevalueattribute.
-
-
-
Method Detail
-
getId
public String getId()
- Specified by:
getIdin interfaceQuestionnaireDatabase.MetadataRow- Returns:
- The value of the
idattribute
-
getValue
public io.dialob.api.questionnaire.Questionnaire.Metadata getValue()
- Specified by:
getValuein interfaceQuestionnaireDatabase.MetadataRow- Returns:
- The value of the
valueattribute
-
withId
public final ImmutableMetadataRow 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
-
withValue
public final ImmutableMetadataRow withValue(io.dialob.api.questionnaire.Questionnaire.Metadata 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- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableMetadataRowthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id,value.
-
toString
public String toString()
Prints the immutable valueMetadataRowwith attribute values.
-
of
public static ImmutableMetadataRow of(String id, io.dialob.api.questionnaire.Questionnaire.Metadata value)
Construct a new immutableMetadataRowinstance.- Parameters:
id- The value for theidattributevalue- The value for thevalueattribute- Returns:
- An immutable MetadataRow instance
-
copyOf
public static ImmutableMetadataRow copyOf(QuestionnaireDatabase.MetadataRow instance)
Creates an immutable copy of aQuestionnaireDatabase.MetadataRowvalue. 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 MetadataRow instance
-
builder
public static ImmutableMetadataRow.Builder builder()
Creates a builder forImmutableMetadataRow.ImmutableMetadataRow.builder() .id(String) // requiredid.value(io.dialob.api.questionnaire.Questionnaire.Metadata) // requiredvalue.build();- Returns:
- A new ImmutableMetadataRow builder
-
-