org.hisp.dhis.rules.models.AutoValue_RuleEvent Maven / Gradle / Ivy
package org.hisp.dhis.rules.models;
import java.util.Date;
import java.util.List;
import javax.annotation.Generated;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_RuleEvent extends RuleEvent {
private final String event;
private final String programStage;
private final String programStageName;
private final RuleEvent.Status status;
private final Date eventDate;
private final Date dueDate;
private final Date completedDate;
private final String organisationUnit;
private final String organisationUnitCode;
private final List dataValues;
private AutoValue_RuleEvent(
String event,
String programStage,
String programStageName,
RuleEvent.Status status,
Date eventDate,
@Nullable Date dueDate,
@Nullable Date completedDate,
String organisationUnit,
@Nullable String organisationUnitCode,
List dataValues) {
this.event = event;
this.programStage = programStage;
this.programStageName = programStageName;
this.status = status;
this.eventDate = eventDate;
this.dueDate = dueDate;
this.completedDate = completedDate;
this.organisationUnit = organisationUnit;
this.organisationUnitCode = organisationUnitCode;
this.dataValues = dataValues;
}
@Nonnull
@Override
public String event() {
return event;
}
@Nonnull
@Override
public String programStage() {
return programStage;
}
@Nonnull
@Override
public String programStageName() {
return programStageName;
}
@Nonnull
@Override
public RuleEvent.Status status() {
return status;
}
@Nonnull
@Override
public Date eventDate() {
return eventDate;
}
@Nullable
@Override
public Date dueDate() {
return dueDate;
}
@Nullable
@Override
public Date completedDate() {
return completedDate;
}
@Nonnull
@Override
public String organisationUnit() {
return organisationUnit;
}
@Nullable
@Override
public String organisationUnitCode() {
return organisationUnitCode;
}
@Nonnull
@Override
public List dataValues() {
return dataValues;
}
@Override
public String toString() {
return "RuleEvent{"
+ "event=" + event + ", "
+ "programStage=" + programStage + ", "
+ "programStageName=" + programStageName + ", "
+ "status=" + status + ", "
+ "eventDate=" + eventDate + ", "
+ "dueDate=" + dueDate + ", "
+ "completedDate=" + completedDate + ", "
+ "organisationUnit=" + organisationUnit + ", "
+ "organisationUnitCode=" + organisationUnitCode + ", "
+ "dataValues=" + dataValues
+ "}";
}
@Override
public boolean equals(Object o) {
if (o == this) {
return true;
}
if (o instanceof RuleEvent) {
RuleEvent that = (RuleEvent) o;
return (this.event.equals(that.event()))
&& (this.programStage.equals(that.programStage()))
&& (this.programStageName.equals(that.programStageName()))
&& (this.status.equals(that.status()))
&& (this.eventDate.equals(that.eventDate()))
&& ((this.dueDate == null) ? (that.dueDate() == null) : this.dueDate.equals(that.dueDate()))
&& ((this.completedDate == null) ? (that.completedDate() == null) : this.completedDate.equals(that.completedDate()))
&& (this.organisationUnit.equals(that.organisationUnit()))
&& ((this.organisationUnitCode == null) ? (that.organisationUnitCode() == null) : this.organisationUnitCode.equals(that.organisationUnitCode()))
&& (this.dataValues.equals(that.dataValues()));
}
return false;
}
@Override
public int hashCode() {
int h = 1;
h *= 1000003;
h ^= this.event.hashCode();
h *= 1000003;
h ^= this.programStage.hashCode();
h *= 1000003;
h ^= this.programStageName.hashCode();
h *= 1000003;
h ^= this.status.hashCode();
h *= 1000003;
h ^= this.eventDate.hashCode();
h *= 1000003;
h ^= (dueDate == null) ? 0 : this.dueDate.hashCode();
h *= 1000003;
h ^= (completedDate == null) ? 0 : this.completedDate.hashCode();
h *= 1000003;
h ^= this.organisationUnit.hashCode();
h *= 1000003;
h ^= (organisationUnitCode == null) ? 0 : this.organisationUnitCode.hashCode();
h *= 1000003;
h ^= this.dataValues.hashCode();
return h;
}
static final class Builder extends RuleEvent.Builder {
private String event;
private String programStage;
private String programStageName;
private RuleEvent.Status status;
private Date eventDate;
private Date dueDate;
private Date completedDate;
private String organisationUnit;
private String organisationUnitCode;
private List dataValues;
Builder() {
}
Builder(RuleEvent source) {
this.event = source.event();
this.programStage = source.programStage();
this.programStageName = source.programStageName();
this.status = source.status();
this.eventDate = source.eventDate();
this.dueDate = source.dueDate();
this.completedDate = source.completedDate();
this.organisationUnit = source.organisationUnit();
this.organisationUnitCode = source.organisationUnitCode();
this.dataValues = source.dataValues();
}
@Override
public RuleEvent.Builder event(String event) {
this.event = event;
return this;
}
@Override
public RuleEvent.Builder programStage(String programStage) {
this.programStage = programStage;
return this;
}
@Override
public RuleEvent.Builder programStageName(String programStageName) {
this.programStageName = programStageName;
return this;
}
@Override
public RuleEvent.Builder status(RuleEvent.Status status) {
this.status = status;
return this;
}
@Override
public RuleEvent.Builder eventDate(Date eventDate) {
this.eventDate = eventDate;
return this;
}
@Override
public RuleEvent.Builder dueDate(@Nullable Date dueDate) {
this.dueDate = dueDate;
return this;
}
@Override
public RuleEvent.Builder completedDate(@Nullable Date completedDate) {
this.completedDate = completedDate;
return this;
}
@Override
public RuleEvent.Builder organisationUnit(String organisationUnit) {
this.organisationUnit = organisationUnit;
return this;
}
@Override
public RuleEvent.Builder organisationUnitCode(@Nullable String organisationUnitCode) {
this.organisationUnitCode = organisationUnitCode;
return this;
}
@Override
public RuleEvent.Builder dataValues(List dataValues) {
this.dataValues = dataValues;
return this;
}
@Override
public RuleEvent build() {
String missing = "";
if (event == null) {
missing += " event";
}
if (programStage == null) {
missing += " programStage";
}
if (programStageName == null) {
missing += " programStageName";
}
if (status == null) {
missing += " status";
}
if (eventDate == null) {
missing += " eventDate";
}
if (organisationUnit == null) {
missing += " organisationUnit";
}
if (dataValues == null) {
missing += " dataValues";
}
if (!missing.isEmpty()) {
throw new IllegalStateException("Missing required properties:" + missing);
}
return new AutoValue_RuleEvent(
this.event,
this.programStage,
this.programStageName,
this.status,
this.eventDate,
this.dueDate,
this.completedDate,
this.organisationUnit,
this.organisationUnitCode,
this.dataValues);
}
}
}