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

io.stargate.db.query.builder.BuiltOther Maven / Gradle / Ivy

There is a newer version: 2.1.0-BETA-19
Show newest version
package io.stargate.db.query.builder;

import io.stargate.db.query.AsyncQueryExecutor;
import io.stargate.db.query.Query;
import io.stargate.db.query.QueryType;
import io.stargate.db.query.TypedValue;
import java.util.Collections;
import java.util.List;
import javax.annotation.Nullable;
import org.apache.cassandra.stargate.utils.MD5Digest;

public class BuiltOther extends BuiltQuery {
  private final String queryString;

  BuiltOther(TypedValue.Codec codec, AsyncQueryExecutor executor, String queryString) {
    this(codec, null, executor, queryString);
  }

  private BuiltOther(
      TypedValue.Codec codec,
      @Nullable MD5Digest preparedId,
      AsyncQueryExecutor executor,
      String queryString) {
    super(QueryType.OTHER, codec, preparedId, executor, Collections.emptyList());
    this.queryString = queryString;
  }

  @Override
  public QueryType type() {
    return QueryType.OTHER;
  }

  @Override
  public String queryStringForPreparation() {
    return queryString;
  }

  @Override
  protected BuiltOther.Bound createBoundQuery(List values) {
    return new Bound(this);
  }

  @Override
  public Query withPreparedId(MD5Digest preparedId) {
    return new BuiltOther(valueCodec(), preparedId, executor(), queryString);
  }

  @Override
  public String toString() {
    return queryString;
  }

  public static class Bound extends AbstractBound {
    private Bound(BuiltOther builtQuery) {
      super(builtQuery, Collections.emptyList(), Collections.emptyList());
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy