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

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

package dev.cel.common.ast;

import org.jspecify.nullness.Nullable;

// Generated by com.google.auto.value.processor.AutoOneOfProcessor
final class AutoOneOf_CelExpr_ExprKind {
  private AutoOneOf_CelExpr_ExprKind() {} // There are no instances of this type.

  static CelExpr.ExprKind notSet(CelExpr.CelNotSet notSet) {
    if (notSet == null) {
      throw new NullPointerException();
    }
    return new Impl_notSet(notSet);
  }

  static CelExpr.ExprKind constant(CelConstant constant) {
    if (constant == null) {
      throw new NullPointerException();
    }
    return new Impl_constant(constant);
  }

  static CelExpr.ExprKind ident(CelExpr.CelIdent ident) {
    if (ident == null) {
      throw new NullPointerException();
    }
    return new Impl_ident(ident);
  }

  static CelExpr.ExprKind select(CelExpr.CelSelect select) {
    if (select == null) {
      throw new NullPointerException();
    }
    return new Impl_select(select);
  }

  static CelExpr.ExprKind call(CelExpr.CelCall call) {
    if (call == null) {
      throw new NullPointerException();
    }
    return new Impl_call(call);
  }

  static CelExpr.ExprKind createList(CelExpr.CelCreateList createList) {
    if (createList == null) {
      throw new NullPointerException();
    }
    return new Impl_createList(createList);
  }

  static CelExpr.ExprKind createStruct(CelExpr.CelCreateStruct createStruct) {
    if (createStruct == null) {
      throw new NullPointerException();
    }
    return new Impl_createStruct(createStruct);
  }

  static CelExpr.ExprKind createMap(CelExpr.CelCreateMap createMap) {
    if (createMap == null) {
      throw new NullPointerException();
    }
    return new Impl_createMap(createMap);
  }

  static CelExpr.ExprKind comprehension(CelExpr.CelComprehension comprehension) {
    if (comprehension == null) {
      throw new NullPointerException();
    }
    return new Impl_comprehension(comprehension);
  }

  // Parent class that each implementation will inherit from.
  private abstract static class Parent_ extends CelExpr.ExprKind {
    @Override
    public CelExpr.CelNotSet notSet() {
      throw new UnsupportedOperationException(getKind().toString());
    }
    @Override
    public CelConstant constant() {
      throw new UnsupportedOperationException(getKind().toString());
    }
    @Override
    public CelExpr.CelIdent ident() {
      throw new UnsupportedOperationException(getKind().toString());
    }
    @Override
    public CelExpr.CelSelect select() {
      throw new UnsupportedOperationException(getKind().toString());
    }
    @Override
    public CelExpr.CelCall call() {
      throw new UnsupportedOperationException(getKind().toString());
    }
    @Override
    public CelExpr.CelCreateList createList() {
      throw new UnsupportedOperationException(getKind().toString());
    }
    @Override
    public CelExpr.CelCreateStruct createStruct() {
      throw new UnsupportedOperationException(getKind().toString());
    }
    @Override
    public CelExpr.CelCreateMap createMap() {
      throw new UnsupportedOperationException(getKind().toString());
    }
    @Override
    public CelExpr.CelComprehension comprehension() {
      throw new UnsupportedOperationException(getKind().toString());
    }
  }

  // Implementation when the contained property is "notSet".
  private static final class Impl_notSet extends Parent_ {
    private final CelExpr.CelNotSet notSet;
    Impl_notSet(CelExpr.CelNotSet notSet) {
      this.notSet = notSet;
    }
    @Override
    public CelExpr.CelNotSet notSet() {
      return notSet;
    }
    @Override
    public String toString() {
      return "ExprKind{notSet=" + this.notSet + "}";
    }
    @Override
    public boolean equals(@Nullable Object x) {
      if (x instanceof CelExpr.ExprKind) {
        CelExpr.ExprKind that = (CelExpr.ExprKind) x;
        return this.getKind() == that.getKind()
            && this.notSet.equals(that.notSet());
      } else {
        return false;
      }
    }
    @Override
    public int hashCode() {
      return notSet.hashCode();
    }
    @Override
    public CelExpr.ExprKind.Kind getKind() {
      return CelExpr.ExprKind.Kind.NOT_SET;
    }
  }

  // Implementation when the contained property is "constant".
  private static final class Impl_constant extends Parent_ {
    private final CelConstant constant;
    Impl_constant(CelConstant constant) {
      this.constant = constant;
    }
    @Override
    public CelConstant constant() {
      return constant;
    }
    @Override
    public String toString() {
      return "ExprKind{constant=" + this.constant + "}";
    }
    @Override
    public boolean equals(@Nullable Object x) {
      if (x instanceof CelExpr.ExprKind) {
        CelExpr.ExprKind that = (CelExpr.ExprKind) x;
        return this.getKind() == that.getKind()
            && this.constant.equals(that.constant());
      } else {
        return false;
      }
    }
    @Override
    public int hashCode() {
      return constant.hashCode();
    }
    @Override
    public CelExpr.ExprKind.Kind getKind() {
      return CelExpr.ExprKind.Kind.CONSTANT;
    }
  }

  // Implementation when the contained property is "ident".
  private static final class Impl_ident extends Parent_ {
    private final CelExpr.CelIdent ident;
    Impl_ident(CelExpr.CelIdent ident) {
      this.ident = ident;
    }
    @Override
    public CelExpr.CelIdent ident() {
      return ident;
    }
    @Override
    public String toString() {
      return "ExprKind{ident=" + this.ident + "}";
    }
    @Override
    public boolean equals(@Nullable Object x) {
      if (x instanceof CelExpr.ExprKind) {
        CelExpr.ExprKind that = (CelExpr.ExprKind) x;
        return this.getKind() == that.getKind()
            && this.ident.equals(that.ident());
      } else {
        return false;
      }
    }
    @Override
    public int hashCode() {
      return ident.hashCode();
    }
    @Override
    public CelExpr.ExprKind.Kind getKind() {
      return CelExpr.ExprKind.Kind.IDENT;
    }
  }

  // Implementation when the contained property is "select".
  private static final class Impl_select extends Parent_ {
    private final CelExpr.CelSelect select;
    Impl_select(CelExpr.CelSelect select) {
      this.select = select;
    }
    @Override
    public CelExpr.CelSelect select() {
      return select;
    }
    @Override
    public String toString() {
      return "ExprKind{select=" + this.select + "}";
    }
    @Override
    public boolean equals(@Nullable Object x) {
      if (x instanceof CelExpr.ExprKind) {
        CelExpr.ExprKind that = (CelExpr.ExprKind) x;
        return this.getKind() == that.getKind()
            && this.select.equals(that.select());
      } else {
        return false;
      }
    }
    @Override
    public int hashCode() {
      return select.hashCode();
    }
    @Override
    public CelExpr.ExprKind.Kind getKind() {
      return CelExpr.ExprKind.Kind.SELECT;
    }
  }

  // Implementation when the contained property is "call".
  private static final class Impl_call extends Parent_ {
    private final CelExpr.CelCall call;
    Impl_call(CelExpr.CelCall call) {
      this.call = call;
    }
    @Override
    public CelExpr.CelCall call() {
      return call;
    }
    @Override
    public String toString() {
      return "ExprKind{call=" + this.call + "}";
    }
    @Override
    public boolean equals(@Nullable Object x) {
      if (x instanceof CelExpr.ExprKind) {
        CelExpr.ExprKind that = (CelExpr.ExprKind) x;
        return this.getKind() == that.getKind()
            && this.call.equals(that.call());
      } else {
        return false;
      }
    }
    @Override
    public int hashCode() {
      return call.hashCode();
    }
    @Override
    public CelExpr.ExprKind.Kind getKind() {
      return CelExpr.ExprKind.Kind.CALL;
    }
  }

  // Implementation when the contained property is "createList".
  private static final class Impl_createList extends Parent_ {
    private final CelExpr.CelCreateList createList;
    Impl_createList(CelExpr.CelCreateList createList) {
      this.createList = createList;
    }
    @Override
    public CelExpr.CelCreateList createList() {
      return createList;
    }
    @Override
    public String toString() {
      return "ExprKind{createList=" + this.createList + "}";
    }
    @Override
    public boolean equals(@Nullable Object x) {
      if (x instanceof CelExpr.ExprKind) {
        CelExpr.ExprKind that = (CelExpr.ExprKind) x;
        return this.getKind() == that.getKind()
            && this.createList.equals(that.createList());
      } else {
        return false;
      }
    }
    @Override
    public int hashCode() {
      return createList.hashCode();
    }
    @Override
    public CelExpr.ExprKind.Kind getKind() {
      return CelExpr.ExprKind.Kind.CREATE_LIST;
    }
  }

  // Implementation when the contained property is "createStruct".
  private static final class Impl_createStruct extends Parent_ {
    private final CelExpr.CelCreateStruct createStruct;
    Impl_createStruct(CelExpr.CelCreateStruct createStruct) {
      this.createStruct = createStruct;
    }
    @Override
    public CelExpr.CelCreateStruct createStruct() {
      return createStruct;
    }
    @Override
    public String toString() {
      return "ExprKind{createStruct=" + this.createStruct + "}";
    }
    @Override
    public boolean equals(@Nullable Object x) {
      if (x instanceof CelExpr.ExprKind) {
        CelExpr.ExprKind that = (CelExpr.ExprKind) x;
        return this.getKind() == that.getKind()
            && this.createStruct.equals(that.createStruct());
      } else {
        return false;
      }
    }
    @Override
    public int hashCode() {
      return createStruct.hashCode();
    }
    @Override
    public CelExpr.ExprKind.Kind getKind() {
      return CelExpr.ExprKind.Kind.CREATE_STRUCT;
    }
  }

  // Implementation when the contained property is "createMap".
  private static final class Impl_createMap extends Parent_ {
    private final CelExpr.CelCreateMap createMap;
    Impl_createMap(CelExpr.CelCreateMap createMap) {
      this.createMap = createMap;
    }
    @Override
    public CelExpr.CelCreateMap createMap() {
      return createMap;
    }
    @Override
    public String toString() {
      return "ExprKind{createMap=" + this.createMap + "}";
    }
    @Override
    public boolean equals(@Nullable Object x) {
      if (x instanceof CelExpr.ExprKind) {
        CelExpr.ExprKind that = (CelExpr.ExprKind) x;
        return this.getKind() == that.getKind()
            && this.createMap.equals(that.createMap());
      } else {
        return false;
      }
    }
    @Override
    public int hashCode() {
      return createMap.hashCode();
    }
    @Override
    public CelExpr.ExprKind.Kind getKind() {
      return CelExpr.ExprKind.Kind.CREATE_MAP;
    }
  }

  // Implementation when the contained property is "comprehension".
  private static final class Impl_comprehension extends Parent_ {
    private final CelExpr.CelComprehension comprehension;
    Impl_comprehension(CelExpr.CelComprehension comprehension) {
      this.comprehension = comprehension;
    }
    @Override
    public CelExpr.CelComprehension comprehension() {
      return comprehension;
    }
    @Override
    public String toString() {
      return "ExprKind{comprehension=" + this.comprehension + "}";
    }
    @Override
    public boolean equals(@Nullable Object x) {
      if (x instanceof CelExpr.ExprKind) {
        CelExpr.ExprKind that = (CelExpr.ExprKind) x;
        return this.getKind() == that.getKind()
            && this.comprehension.equals(that.comprehension());
      } else {
        return false;
      }
    }
    @Override
    public int hashCode() {
      return comprehension.hashCode();
    }
    @Override
    public CelExpr.ExprKind.Kind getKind() {
      return CelExpr.ExprKind.Kind.COMPREHENSION;
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy