org.molgenis.questionnaires.response.AutoValue_QuestionnaireResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of molgenis-questionnaires Show documentation
Show all versions of molgenis-questionnaires Show documentation
Plugin module for gathering information from respondents using series of questions.
package org.molgenis.questionnaires.response;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
import org.molgenis.questionnaires.meta.QuestionnaireStatus;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_QuestionnaireResponse extends QuestionnaireResponse {
private final String id;
private final String label;
private final String description;
private final QuestionnaireStatus status;
AutoValue_QuestionnaireResponse(
String id,
String label,
@Nullable String description,
QuestionnaireStatus status) {
if (id == null) {
throw new NullPointerException("Null id");
}
this.id = id;
if (label == null) {
throw new NullPointerException("Null label");
}
this.label = label;
this.description = description;
if (status == null) {
throw new NullPointerException("Null status");
}
this.status = status;
}
@Override
public String getId() {
return id;
}
@Override
public String getLabel() {
return label;
}
@Nullable
@CheckForNull
@Override
public String getDescription() {
return description;
}
@Override
public QuestionnaireStatus getStatus() {
return status;
}
@Override
public String toString() {
return "QuestionnaireResponse{"
+ "id=" + id + ", "
+ "label=" + label + ", "
+ "description=" + description + ", "
+ "status=" + status
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof QuestionnaireResponse) {
QuestionnaireResponse that = (QuestionnaireResponse) o;
return this.id.equals(that.getId())
&& this.label.equals(that.getLabel())
&& (this.description == null ? that.getDescription() == null : this.description.equals(that.getDescription()))
&& this.status.equals(that.getStatus());
}
return false;
}
@Override
public int hashCode() {
int h$ = 1;
h$ *= 1000003;
h$ ^= id.hashCode();
h$ *= 1000003;
h$ ^= label.hashCode();
h$ *= 1000003;
h$ ^= (description == null) ? 0 : description.hashCode();
h$ *= 1000003;
h$ ^= status.hashCode();
return h$;
}
}