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

dev.cel.common.ast.AutoValue_CelExpr_CelCall Maven / Gradle / Ivy

There is a newer version: 0.7.1
Show newest version
package dev.cel.common.ast;

import com.google.common.collect.ImmutableList;
import java.util.Optional;
import org.jspecify.nullness.Nullable;

// Generated by com.google.auto.value.processor.AutoValueProcessor
final class AutoValue_CelExpr_CelCall extends CelExpr.CelCall {

  private final Optional target;

  private final String function;

  private final ImmutableList args;

  private AutoValue_CelExpr_CelCall(
      Optional target,
      String function,
      ImmutableList args) {
    this.target = target;
    this.function = function;
    this.args = args;
  }

  @Override
  public Optional target() {
    return target;
  }

  @Override
  public String function() {
    return function;
  }

  @Override
  public ImmutableList args() {
    return args;
  }

  @Override
  public String toString() {
    return "CelCall{"
        + "target=" + target + ", "
        + "function=" + function + ", "
        + "args=" + args
        + "}";
  }

  @Override
  public boolean equals(@Nullable Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof CelExpr.CelCall) {
      CelExpr.CelCall that = (CelExpr.CelCall) o;
      return this.target.equals(that.target())
          && this.function.equals(that.function())
          && this.args.equals(that.args());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= target.hashCode();
    h$ *= 1000003;
    h$ ^= function.hashCode();
    h$ *= 1000003;
    h$ ^= args.hashCode();
    return h$;
  }

  @Override
  CelExpr.CelCall.Builder autoToBuilder() {
    return new Builder(this);
  }

  static final class Builder extends CelExpr.CelCall.Builder {
    private Optional target = Optional.empty();
    private @Nullable String function;
    private @Nullable ImmutableList args;
    Builder() {
    }
    private Builder(CelExpr.CelCall source) {
      this.target = source.target();
      this.function = source.function();
      this.args = source.args();
    }
    @Override
    public CelExpr.CelCall.Builder setTarget(CelExpr target) {
      this.target = Optional.of(target);
      return this;
    }
    @Override
    public CelExpr.CelCall.Builder setTarget(Optional target) {
      if (target == null) {
        throw new NullPointerException("Null target");
      }
      this.target = target;
      return this;
    }
    @Override
    public Optional target() {
      return target;
    }
    @Override
    public CelExpr.CelCall.Builder setFunction(String function) {
      if (function == null) {
        throw new NullPointerException("Null function");
      }
      this.function = function;
      return this;
    }
    @Override
    CelExpr.CelCall.Builder setArgs(ImmutableList args) {
      if (args == null) {
        throw new NullPointerException("Null args");
      }
      this.args = args;
      return this;
    }
    @Override
    ImmutableList args() {
      if (this.args == null) {
        throw new IllegalStateException("Property \"args\" has not been set");
      }
      return args;
    }
    @Override
    CelExpr.CelCall autoBuild() {
      if (this.function == null
          || this.args == null) {
        StringBuilder missing = new StringBuilder();
        if (this.function == null) {
          missing.append(" function");
        }
        if (this.args == null) {
          missing.append(" args");
        }
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_CelExpr_CelCall(
          this.target,
          this.function,
          this.args);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy