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

dev.cel.common.AutoValue_CelFunctionDecl Maven / Gradle / Ivy

package dev.cel.common;

import com.google.common.collect.ImmutableSet;
import org.jspecify.nullness.Nullable;

// Generated by com.google.auto.value.processor.AutoValueProcessor
final class AutoValue_CelFunctionDecl extends CelFunctionDecl {

  private final String name;

  private final ImmutableSet overloads;

  private AutoValue_CelFunctionDecl(
      String name,
      ImmutableSet overloads) {
    this.name = name;
    this.overloads = overloads;
  }

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

  @Override
  public ImmutableSet overloads() {
    return overloads;
  }

  @Override
  public String toString() {
    return "CelFunctionDecl{"
        + "name=" + name + ", "
        + "overloads=" + overloads
        + "}";
  }

  @Override
  public boolean equals(@Nullable Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof CelFunctionDecl) {
      CelFunctionDecl that = (CelFunctionDecl) o;
      return this.name.equals(that.name())
          && this.overloads.equals(that.overloads());
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= name.hashCode();
    h$ *= 1000003;
    h$ ^= overloads.hashCode();
    return h$;
  }

  @Override
  public CelFunctionDecl.Builder toBuilder() {
    return new Builder(this);
  }

  static final class Builder extends CelFunctionDecl.Builder {
    private @Nullable String name;
    private ImmutableSet.@Nullable Builder overloadsBuilder$;
    private @Nullable ImmutableSet overloads;
    Builder() {
    }
    private Builder(CelFunctionDecl source) {
      this.name = source.name();
      this.overloads = source.overloads();
    }
    @Override
    public CelFunctionDecl.Builder setName(String name) {
      if (name == null) {
        throw new NullPointerException("Null name");
      }
      this.name = name;
      return this;
    }
    @Override
    public String name() {
      if (this.name == null) {
        throw new IllegalStateException("Property \"name\" has not been set");
      }
      return name;
    }
    @Override
    public CelFunctionDecl.Builder setOverloads(ImmutableSet overloads) {
      if (overloads == null) {
        throw new NullPointerException("Null overloads");
      }
      if (overloadsBuilder$ != null) {
        throw new IllegalStateException("Cannot set overloads after calling overloadsBuilder()");
      }
      this.overloads = overloads;
      return this;
    }
    @Override
    public ImmutableSet.Builder overloadsBuilder() {
      if (overloadsBuilder$ == null) {
        if (overloads == null) {
          overloadsBuilder$ = ImmutableSet.builder();
        } else {
          overloadsBuilder$ = ImmutableSet.builder();
          overloadsBuilder$.addAll(overloads);
          overloads = null;
        }
      }
      return overloadsBuilder$;
    }
    @Override
    public ImmutableSet overloads() {
      if (overloadsBuilder$ != null) {
        return overloadsBuilder$.build();
      }
      if (overloads == null) {
        overloads = ImmutableSet.of();
      }
      return overloads;
    }
    @Override
    public CelFunctionDecl build() {
      if (overloadsBuilder$ != null) {
        this.overloads = overloadsBuilder$.build();
      } else if (this.overloads == null) {
        this.overloads = ImmutableSet.of();
      }
      if (this.name == null) {
        String missing = " name";
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_CelFunctionDecl(
          this.name,
          this.overloads);
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy