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

org.hisp.dhis.rules.models.AutoValue_Rule Maven / Gradle / Ivy


package org.hisp.dhis.rules.models;

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_Rule extends Rule {

  private final String name;
  private final String programStage;
  private final Integer priority;
  private final String condition;
  private final List actions;
  private final String uid;

  AutoValue_Rule(
      @Nullable String name,
      @Nullable String programStage,
      @Nullable Integer priority,
      String condition,
      List actions,
      String uid) {
    this.name = name;
    this.programStage = programStage;
    this.priority = priority;
    if (condition == null) {
      throw new NullPointerException("Null condition");
    }
    this.condition = condition;
    if (actions == null) {
      throw new NullPointerException("Null actions");
    }
    this.actions = actions;
    if (uid == null) {
      throw new NullPointerException("Null uid");
    }
    this.uid = uid;
  }

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

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

  @Nullable
  @Override
  public Integer priority() {
    return priority;
  }

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

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

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

  @Override
  public String toString() {
    return "Rule{"
        + "name=" + name + ", "
        + "programStage=" + programStage + ", "
        + "priority=" + priority + ", "
        + "condition=" + condition + ", "
        + "actions=" + actions + ", "
        + "uid=" + uid
        + "}";
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof Rule) {
      Rule that = (Rule) o;
      return ((this.name == null) ? (that.name() == null) : this.name.equals(that.name()))
           && ((this.programStage == null) ? (that.programStage() == null) : this.programStage.equals(that.programStage()))
           && ((this.priority == null) ? (that.priority() == null) : this.priority.equals(that.priority()))
           && (this.condition.equals(that.condition()))
           && (this.actions.equals(that.actions()))
           && (this.uid.equals(that.uid()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h = 1;
    h *= 1000003;
    h ^= (name == null) ? 0 : this.name.hashCode();
    h *= 1000003;
    h ^= (programStage == null) ? 0 : this.programStage.hashCode();
    h *= 1000003;
    h ^= (priority == null) ? 0 : this.priority.hashCode();
    h *= 1000003;
    h ^= this.condition.hashCode();
    h *= 1000003;
    h ^= this.actions.hashCode();
    h *= 1000003;
    h ^= this.uid.hashCode();
    return h;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy