All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hisp.dhis.rules.models.AutoValue_RuleEnrollment 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_RuleEnrollment extends RuleEnrollment {

  private final String enrollment;
  private final String programName;
  private final Date incidentDate;
  private final Date enrollmentDate;
  private final RuleEnrollment.Status status;
  private final String organisationUnit;
  private final String organisationUnitCode;
  private final List attributeValues;

  private AutoValue_RuleEnrollment(
      String enrollment,
      String programName,
      Date incidentDate,
      Date enrollmentDate,
      RuleEnrollment.Status status,
      String organisationUnit,
      @Nullable String organisationUnitCode,
      List attributeValues) {
    this.enrollment = enrollment;
    this.programName = programName;
    this.incidentDate = incidentDate;
    this.enrollmentDate = enrollmentDate;
    this.status = status;
    this.organisationUnit = organisationUnit;
    this.organisationUnitCode = organisationUnitCode;
    this.attributeValues = attributeValues;
  }

  @Nonnull
  @Override
  public String enrollment() {
    return enrollment;
  }

  @Nonnull
  @Override
  public String programName() {
    return programName;
  }

  @Nonnull
  @Override
  public Date incidentDate() {
    return incidentDate;
  }

  @Nonnull
  @Override
  public Date enrollmentDate() {
    return enrollmentDate;
  }

  @Nonnull
  @Override
  public RuleEnrollment.Status status() {
    return status;
  }

  @Nonnull
  @Override
  public String organisationUnit() {
    return organisationUnit;
  }

  @Nullable
  @Override
  public String organisationUnitCode() {
    return organisationUnitCode;
  }

  @Nonnull
  @Override
  public List attributeValues() {
    return attributeValues;
  }

  @Override
  public String toString() {
    return "RuleEnrollment{"
        + "enrollment=" + enrollment + ", "
        + "programName=" + programName + ", "
        + "incidentDate=" + incidentDate + ", "
        + "enrollmentDate=" + enrollmentDate + ", "
        + "status=" + status + ", "
        + "organisationUnit=" + organisationUnit + ", "
        + "organisationUnitCode=" + organisationUnitCode + ", "
        + "attributeValues=" + attributeValues
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof RuleEnrollment) {
      RuleEnrollment that = (RuleEnrollment) o;
      return (this.enrollment.equals(that.enrollment()))
           && (this.programName.equals(that.programName()))
           && (this.incidentDate.equals(that.incidentDate()))
           && (this.enrollmentDate.equals(that.enrollmentDate()))
           && (this.status.equals(that.status()))
           && (this.organisationUnit.equals(that.organisationUnit()))
           && ((this.organisationUnitCode == null) ? (that.organisationUnitCode() == null) : this.organisationUnitCode.equals(that.organisationUnitCode()))
           && (this.attributeValues.equals(that.attributeValues()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= this.enrollment.hashCode();
    h *= 1000003;
    h ^= this.programName.hashCode();
    h *= 1000003;
    h ^= this.incidentDate.hashCode();
    h *= 1000003;
    h ^= this.enrollmentDate.hashCode();
    h *= 1000003;
    h ^= this.status.hashCode();
    h *= 1000003;
    h ^= this.organisationUnit.hashCode();
    h *= 1000003;
    h ^= (organisationUnitCode == null) ? 0 : this.organisationUnitCode.hashCode();
    h *= 1000003;
    h ^= this.attributeValues.hashCode();
    return h;
  }

  static final class Builder extends RuleEnrollment.Builder {
    private String enrollment;
    private String programName;
    private Date incidentDate;
    private Date enrollmentDate;
    private RuleEnrollment.Status status;
    private String organisationUnit;
    private String organisationUnitCode;
    private List attributeValues;
    Builder() {
    }
    Builder(RuleEnrollment source) {
      this.enrollment = source.enrollment();
      this.programName = source.programName();
      this.incidentDate = source.incidentDate();
      this.enrollmentDate = source.enrollmentDate();
      this.status = source.status();
      this.organisationUnit = source.organisationUnit();
      this.organisationUnitCode = source.organisationUnitCode();
      this.attributeValues = source.attributeValues();
    }
    @Override
    public RuleEnrollment.Builder enrollment(String enrollment) {
      this.enrollment = enrollment;
      return this;
    }
    @Override
    public RuleEnrollment.Builder programName(String programName) {
      this.programName = programName;
      return this;
    }
    @Override
    public RuleEnrollment.Builder incidentDate(Date incidentDate) {
      this.incidentDate = incidentDate;
      return this;
    }
    @Override
    public RuleEnrollment.Builder enrollmentDate(Date enrollmentDate) {
      this.enrollmentDate = enrollmentDate;
      return this;
    }
    @Override
    public RuleEnrollment.Builder status(RuleEnrollment.Status status) {
      this.status = status;
      return this;
    }
    @Override
    public RuleEnrollment.Builder organisationUnit(String organisationUnit) {
      this.organisationUnit = organisationUnit;
      return this;
    }
    @Override
    public RuleEnrollment.Builder organisationUnitCode(@Nullable String organisationUnitCode) {
      this.organisationUnitCode = organisationUnitCode;
      return this;
    }
    @Override
    public RuleEnrollment.Builder attributeValues(List attributeValues) {
      this.attributeValues = attributeValues;
      return this;
    }
    @Override
    public RuleEnrollment build() {
      String missing = "";
      if (enrollment == null) {
        missing += " enrollment";
      }
      if (programName == null) {
        missing += " programName";
      }
      if (incidentDate == null) {
        missing += " incidentDate";
      }
      if (enrollmentDate == null) {
        missing += " enrollmentDate";
      }
      if (status == null) {
        missing += " status";
      }
      if (organisationUnit == null) {
        missing += " organisationUnit";
      }
      if (attributeValues == null) {
        missing += " attributeValues";
      }
      if (!missing.isEmpty()) {
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_RuleEnrollment(
          this.enrollment,
          this.programName,
          this.incidentDate,
          this.enrollmentDate,
          this.status,
          this.organisationUnit,
          this.organisationUnitCode,
          this.attributeValues);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy