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

org.apache.beam.sdk.io.astra.db.AutoValue_AstraDbIO_Write Maven / Gradle / Ivy

The newest version!
package org.apache.beam.sdk.io.astra.db;

import com.datastax.oss.driver.api.core.CqlSession;
import java.util.Optional;
import javax.annotation.Nullable;
import javax.annotation.processing.Generated;
import org.apache.beam.sdk.io.astra.db.mapping.AstraDbMapper;
import org.apache.beam.sdk.options.ValueProvider;
import org.apache.beam.sdk.transforms.SerializableFunction;

@SuppressWarnings("rawtypes")
@Generated("com.google.auto.value.processor.AutoValueProcessor")
final class AutoValue_AstraDbIO_Write extends AstraDbIO.Write {

  private final ValueProvider token;

  private final ValueProvider secureConnectBundle;

  private final ValueProvider keyspace;

  private final Class entity;

  private final AstraDbIO.MutationType mutationType;

  private final SerializableFunction> mapperFactoryFn;

  private AutoValue_AstraDbIO_Write(
      @Nullable ValueProvider token,
      @Nullable ValueProvider secureConnectBundle,
      @Nullable ValueProvider keyspace,
      @Nullable Class entity,
      AstraDbIO.MutationType mutationType,
      @Nullable SerializableFunction> mapperFactoryFn) {
    this.token = token;
    this.secureConnectBundle = secureConnectBundle;
    this.keyspace = keyspace;
    this.entity = entity;
    this.mutationType = mutationType;
    this.mapperFactoryFn = mapperFactoryFn;
  }

  @Nullable
  @Override
  ValueProvider token() {
    return token;
  }

  @Nullable
  @Override
  ValueProvider secureConnectBundle() {
    return secureConnectBundle;
  }

  @Nullable
  @Override
  ValueProvider keyspace() {
    return keyspace;
  }

  @Nullable
  @Override
  Class entity() {
    return entity;
  }

  @Override
  AstraDbIO.MutationType mutationType() {
    return mutationType;
  }

  @Nullable
  @Override
  SerializableFunction> mapperFactoryFn() {
    return mapperFactoryFn;
  }

  @Override
  public boolean equals(Object o) {
    if (o == this) {
      return true;
    }
    if (o instanceof AstraDbIO.Write) {
      AstraDbIO.Write that = (AstraDbIO.Write) o;
      return (this.token == null ? that.token() == null : this.token.equals(that.token()))
          && (this.secureConnectBundle == null ? that.secureConnectBundle() == null : this.secureConnectBundle.equals(that.secureConnectBundle()))
          && (this.keyspace == null ? that.keyspace() == null : this.keyspace.equals(that.keyspace()))
          && (this.entity == null ? that.entity() == null : this.entity.equals(that.entity()))
          && this.mutationType.equals(that.mutationType())
          && (this.mapperFactoryFn == null ? that.mapperFactoryFn() == null : this.mapperFactoryFn.equals(that.mapperFactoryFn()));
    }
    return false;
  }

  @Override
  public int hashCode() {
    int h$ = 1;
    h$ *= 1000003;
    h$ ^= (token == null) ? 0 : token.hashCode();
    h$ *= 1000003;
    h$ ^= (secureConnectBundle == null) ? 0 : secureConnectBundle.hashCode();
    h$ *= 1000003;
    h$ ^= (keyspace == null) ? 0 : keyspace.hashCode();
    h$ *= 1000003;
    h$ ^= (entity == null) ? 0 : entity.hashCode();
    h$ *= 1000003;
    h$ ^= mutationType.hashCode();
    h$ *= 1000003;
    h$ ^= (mapperFactoryFn == null) ? 0 : mapperFactoryFn.hashCode();
    return h$;
  }

  @Override
  AstraDbIO.Write.Builder builder() {
    return new Builder(this);
  }

  static final class Builder extends AstraDbIO.Write.Builder {
    private ValueProvider token;
    private ValueProvider secureConnectBundle;
    private ValueProvider keyspace;
    private Class entity;
    private AstraDbIO.MutationType mutationType;
    private SerializableFunction> mapperFactoryFn;
    Builder() {
    }
    private Builder(AstraDbIO.Write source) {
      this.token = source.token();
      this.secureConnectBundle = source.secureConnectBundle();
      this.keyspace = source.keyspace();
      this.entity = source.entity();
      this.mutationType = source.mutationType();
      this.mapperFactoryFn = source.mapperFactoryFn();
    }
    @Override
    AstraDbIO.Write.Builder setToken(ValueProvider token) {
      this.token = token;
      return this;
    }
    @Override
    AstraDbIO.Write.Builder setSecureConnectBundle(ValueProvider secureConnectBundle) {
      this.secureConnectBundle = secureConnectBundle;
      return this;
    }
    @Override
    AstraDbIO.Write.Builder setKeyspace(ValueProvider keyspace) {
      this.keyspace = keyspace;
      return this;
    }
    @Override
    AstraDbIO.Write.Builder setEntity(Class entity) {
      this.entity = entity;
      return this;
    }
    @Override
    @Nullable Optional> entity() {
      if (entity == null) {
        return Optional.empty();
      }
      return Optional.of(entity);
    }
    @Override
    AstraDbIO.Write.Builder setMutationType(AstraDbIO.MutationType mutationType) {
      if (mutationType == null) {
        throw new NullPointerException("Null mutationType");
      }
      this.mutationType = mutationType;
      return this;
    }
    @Override
    AstraDbIO.Write.Builder setMapperFactoryFn(SerializableFunction> mapperFactoryFn) {
      this.mapperFactoryFn = mapperFactoryFn;
      return this;
    }
    @Override
    @Nullable Optional>> mapperFactoryFn() {
      if (mapperFactoryFn == null) {
        return Optional.empty();
      }
      return Optional.of(mapperFactoryFn);
    }
    @Override
    AstraDbIO.Write autoBuild() {
      if (this.mutationType == null) {
        String missing = " mutationType";
        throw new IllegalStateException("Missing required properties:" + missing);
      }
      return new AutoValue_AstraDbIO_Write(
          this.token,
          this.secureConnectBundle,
          this.keyspace,
          this.entity,
          this.mutationType,
          this.mapperFactoryFn);
    }
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy