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

org.flyte.api.v1.AutoOneOf_BooleanExpression Maven / Gradle / Ivy

There is a newer version: 0.4.60
Show newest version
package org.flyte.api.v1;

import javax.annotation.processing.Generated;

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

  static BooleanExpression comparison(ComparisonExpression comparison) {
    if (comparison == null) {
      throw new NullPointerException();
    }
    return new Impl_comparison(comparison);
  }

  static BooleanExpression conjunction(ConjunctionExpression conjunction) {
    if (conjunction == null) {
      throw new NullPointerException();
    }
    return new Impl_conjunction(conjunction);
  }

  // Parent class that each implementation will inherit from.
  private abstract static class Parent_ extends BooleanExpression {
    @Override
    public ComparisonExpression comparison() {
      throw new UnsupportedOperationException(kind().toString());
    }
    @Override
    public ConjunctionExpression conjunction() {
      throw new UnsupportedOperationException(kind().toString());
    }
  }

  // Implementation when the contained property is "comparison".
  private static final class Impl_comparison extends Parent_ {
    private final ComparisonExpression comparison;
    Impl_comparison(ComparisonExpression comparison) {
      this.comparison = comparison;
    }
    @Override
    public ComparisonExpression comparison() {
      return comparison;
    }
    @Override
    public String toString() {
      return "BooleanExpression{comparison=" + this.comparison + "}";
    }
    @Override
    public boolean equals(Object x) {
      if (x instanceof BooleanExpression) {
        BooleanExpression that = (BooleanExpression) x;
        return this.kind() == that.kind()
            && this.comparison.equals(that.comparison());
      } else {
        return false;
      }
    }
    @Override
    public int hashCode() {
      return comparison.hashCode();
    }
    @Override
    public BooleanExpression.Kind kind() {
      return BooleanExpression.Kind.COMPARISON;
    }
  }

  // Implementation when the contained property is "conjunction".
  private static final class Impl_conjunction extends Parent_ {
    private final ConjunctionExpression conjunction;
    Impl_conjunction(ConjunctionExpression conjunction) {
      this.conjunction = conjunction;
    }
    @Override
    public ConjunctionExpression conjunction() {
      return conjunction;
    }
    @Override
    public String toString() {
      return "BooleanExpression{conjunction=" + this.conjunction + "}";
    }
    @Override
    public boolean equals(Object x) {
      if (x instanceof BooleanExpression) {
        BooleanExpression that = (BooleanExpression) x;
        return this.kind() == that.kind()
            && this.conjunction.equals(that.conjunction());
      } else {
        return false;
      }
    }
    @Override
    public int hashCode() {
      return conjunction.hashCode();
    }
    @Override
    public BooleanExpression.Kind kind() {
      return BooleanExpression.Kind.CONJUNCTION;
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy