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

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

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

import java.util.List;
import java.util.Map;
import javax.annotation.processing.Generated;

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

  static BindingData scalar(Scalar scalar) {
    if (scalar == null) {
      throw new NullPointerException();
    }
    return new Impl_scalar(scalar);
  }

  static BindingData collection(List collection) {
    if (collection == null) {
      throw new NullPointerException();
    }
    return new Impl_collection(collection);
  }

  static BindingData promise(OutputReference promise) {
    if (promise == null) {
      throw new NullPointerException();
    }
    return new Impl_promise(promise);
  }

  static BindingData map(Map map) {
    if (map == null) {
      throw new NullPointerException();
    }
    return new Impl_map(map);
  }

  // Parent class that each implementation will inherit from.
  private abstract static class Parent_ extends BindingData {
    @Override
    public Scalar scalar() {
      throw new UnsupportedOperationException(kind().toString());
    }
    @Override
    public List collection() {
      throw new UnsupportedOperationException(kind().toString());
    }
    @Override
    public OutputReference promise() {
      throw new UnsupportedOperationException(kind().toString());
    }
    @Override
    public Map map() {
      throw new UnsupportedOperationException(kind().toString());
    }
  }

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

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

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

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

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy