Modifies the given N1QL query (as a {@link JsonObject}) to reflect these {@link N1qlParams}.
@param queryJson the N1QL query
755
public void injectParams(JsonObject queryJson) {
        if (this.serverSideTimeout != null) {
            queryJson.put("timeout", this.serverSideTimeout);
        }
        if (this.consistency != null) {
            queryJson.put("scan_consistency", this.consistency.n1ql());
        }
        if (this.scanWait != null
                && (ScanConsistency.REQUEST_PLUS == this.consistency
                || ScanConsistency.STATEMENT_PLUS == this.consistency)) {
            queryJson.put("scan_wait", this.scanWait);
        }
        if (this.clientContextId != null) {
            queryJson.put("client_context_id", this.clientContextId);
        }
        if (this.maxParallelism != null) {
            queryJson.put("max_parallelism", this.maxParallelism.toString());
        }
        if (this.pipelineCap != null) {
            queryJson.put("pipeline_cap", this.pipelineCap.toString());
        }
        if (this.pipelineBatch != null) {
            queryJson.put("pipeline_batch", this.pipelineBatch.toString());
        }
        if (this.scanCap != null) {
            queryJson.put("scan_cap", this.scanCap.toString());
        }
        if (this.disableMetrics) {
            queryJson.put("metrics", false);
        }

        if (this.mutationState != null) {
            if (this.consistency != null) {
                throw new IllegalArgumentException("`consistency(...)` cannot be used "
                    + "together with `consistentWith(...)`");
            }
            queryJson.put("scan_vectors", mutationState.export());
            queryJson.put("scan_consistency", "at_plus");
        }

        if (!this.credentials.isEmpty()) {
            JsonArray creds = JsonArray.create();
            for (Map.Entry<String, String> c : credentials.entrySet()) {
                if (c.getKey() != null && !c.getKey().isEmpty()) {
                    creds.add(JsonObject.create()
                        .put("user", c.getKey())
                        .put("pass", c.getValue()));
                }
            }
            if (!creds.isEmpty()) {
                queryJson.put("creds", creds);
            }
        }

        if (!this.pretty) {
            queryJson.put("pretty", false);
        }

        if (this.readonly) {
            queryJson.put("readonly", true);
        }

        if (this.profile != null) {
            queryJson.put("profile", this.profile.toString());
        }

        if (this.rawParams != null) {
            for (Map.Entry<String, Object> entry : rawParams.entrySet()) {
                queryJson.put(entry.getKey(), entry.getValue());
            }
        }
    }
554816
public static <T> T toBean(JSONObject json, Class<T> beanClass) {
		return null == json ? null : json.toBean(beanClass);
	}
668440
public JSONObject multipleQueries(List<IndexQuery> queries, RequestOptions requestOptions) throws AlgoliaException {
    return multipleQueries(queries, "none", requestOptions);
  }
443323
@Override
	public QueryRequest<ArrayNode> query(String fql) {
		return this.query(fql, mapper.getTypeFactory().constructType(ArrayNode.class));
	}
524867
public void addJSONObject(JSONObject obj)
    {
        if (logger.isLoggable(Level.FINER)) logger.entering(className, "addJSONObject(JSONObject)");

        Vector vect = (Vector) this.jsonObjects.get(obj.objectName);
        if (vect != null)
        {
            vect.add(obj);
        }
        else
        {
            vect = new Vector();
            vect.add(obj);
            this.jsonObjects.put(obj.objectName, vect);
        }

        if (logger.isLoggable(Level.FINER)) logger.exiting(className, "addJSONObject(JSONObject)");
    }
3863
@Override
    public void loadFromJSONObject( JSONObject jobj, Database db ) throws JSONException {
        super.loadFromJSONObject(jobj, db);
        m_lookupType = IndexLookupType.get( jobj.getString( Members.LOOKUP_TYPE.name() ) );
        m_sortDirection = SortDirectionType.get( jobj.getString( Members.SORT_DIRECTION.name() ) );
        if (jobj.has(Members.HAS_OFFSET_RANK.name())) {
            m_hasOffsetRankOptimization = jobj.getBoolean(Members.HAS_OFFSET_RANK.name());
        }
        m_purpose = jobj.has(Members.PURPOSE.name()) ?
                jobj.getInt(Members.PURPOSE.name()) : FOR_SCANNING_PERFORMANCE_OR_ORDERING;
        m_targetIndexName = jobj.getString(Members.TARGET_INDEX_NAME.name());
        m_catalogIndex = db.getTables().get(super.m_targetTableName).getIndexes().get(m_targetIndexName);
        // load end_expression
        m_endExpression = AbstractExpression.fromJSONChild(jobj, Members.END_EXPRESSION.name(), m_tableScan);
        // load initial_expression
        m_initialExpression = AbstractExpression.fromJSONChild(jobj, Members.INITIAL_EXPRESSION.name(), m_tableScan);
        // load searchkey_expressions
        AbstractExpression.loadFromJSONArrayChild(m_searchkeyExpressions, jobj,
                Members.SEARCHKEY_EXPRESSIONS.name(), m_tableScan);
        // load COMPARE_NOTDISTINCT flag vector
        loadBooleanArrayFromJSONObject(jobj, Members.COMPARE_NOTDISTINCT.name(), m_compareNotDistinct);
        // load skip_null_predicate
        m_skip_null_predicate = AbstractExpression.fromJSONChild(jobj, Members.SKIP_NULL_PREDICATE.name(), m_tableScan);
    }
1285487
public static void config(JSONObject jsonObject) {
        config(jsonObject.getString("host"), jsonObject.getString("personal"), jsonObject.getString("from"),
                jsonObject.getString("key"), jsonObject.getInteger("port"));
        setSslEnable(jsonObject.getBoolean("ssl"));
    }
1038379
public JSONObject addObject(JSONObject obj, RequestOptions requestOptions) throws AlgoliaException {
    return client.postRequest("/1/indexes/" + encodedIndexName, obj.toString(), true, false, requestOptions);
  }
901178
private void setJsonSchemaProperties(JsonObject jsonObject) {
    setColumnName(jsonObject.get(COLUMN_NAME_KEY).getAsString());
    setDataType(jsonObject.get(DATA_TYPE_KEY).getAsJsonObject());
    setNullable(jsonObject.has(IS_NULLABLE_KEY) && jsonObject.get(IS_NULLABLE_KEY).getAsBoolean());
    setComment(getOptionalProperty(jsonObject, COMMENT_KEY));
    setDefaultValue(getOptionalProperty(jsonObject, DEFAULT_VALUE_KEY));
  }
949608
private QueryResponse getQueryResponse(JsonNode jsonNode) throws IOException {
		ObjectMapper mapper = new ObjectMapper();

		SimpleModule simpleModule = new SimpleModule("QueryResponseDeserializer", new Version(1, 0, 0, null));
		simpleModule.addDeserializer(QueryResponse.class, new QueryResponseDeserializer());

		mapper.registerModule(simpleModule);

		return mapper.treeToValue(jsonNode, QueryResponse.class);
	}
189293
@Override
    public <T> void setJsonProperty(String propertyName, T value) {
        setProperty(propertyName, value);

    }
837616
private GenericQueryRequest createN1qlRequest(final N1qlQuery query, String bucket, String username, String password,
            InetAddress targetNode) {
        String rawQuery = query.n1ql().toString();
        rawQuery = rawQuery.replaceAll(
          CouchbaseAsyncBucket.CURRENT_BUCKET_IDENTIFIER,
          "`" + bucket + "`"
        );
        String statement = query.statement().toString();
        if (targetNode != null) {
            return GenericQueryRequest.jsonQuery(rawQuery, bucket, username, password, targetNode,
                query.params().clientContextId(), statement);
        } else {
            return GenericQueryRequest.jsonQuery(rawQuery, bucket, username, password,
                query.params().clientContextId(), statement);
        }
    }
954675
private void initiateJPQLObject(final String jpaQuery) {
        JPQLGrammar jpqlGrammar = EclipseLinkJPQLGrammar2_4.instance();
        this.jpqlExpression = new JPQLExpression(jpaQuery, jpqlGrammar, "ql_statement", true);
        setKunderaQueryTypeObject();
    }
552850
public void readJson(ConfigurationBuilderInfo builderInfo, String json) {
      readJson(builderInfo, "", Json.read(json));
   }
141146
public JSONObject deleteBy(Query query, RequestOptions requestOptions) throws AlgoliaException {
    String paramsString = query.getQueryString();
    JSONObject body = new JSONObject();
    try {
      body.put("params", paramsString);
    } catch (JSONException e) {
      throw new RuntimeException(e);
    }
    return client.postRequest("/1/indexes/" + encodedIndexName + "/deleteByQuery", body.toString(), false, false, requestOptions);
  }
363154
public static boolean isNullObject(JSONObject jsonObject, String key) throws JSONException {
		checkArguments(jsonObject, key);
		JSONValue value = jsonObject.get(key);

		boolean isNull = false;
		if (value == null || value.isNull() != null) {
			isNull = true;
		}
		return isNull;
	}
1229562
public static BoxEntity createEntityFromJson(final JsonObject json){
        JsonValue typeValue = json.get(BoxEntity.FIELD_TYPE);
        if (!typeValue.isString()) {
            return null;
        }
        String type = typeValue.asString();
        BoxEntityCreator creator = ENTITY_ADDON_MAP.get(type);
        BoxEntity entity = null;
        if (creator == null){
            entity = new BoxEntity();
        } else {
            entity = creator.createEntity();
        }
        entity.createFromJson(json);
        return entity;
    }