/*
(non-Javadoc)
@see org.springframework.data.repository.query.parser.AbstractQueryCreator#and(org.springframework.data.repository.query.parser.Part, java.lang.Object, java.util.Iterator)
339631
@Override
    protected Expression and(Part part, Expression base, Iterator<Object> iterator) {
        return Expr.and(base, toExpression(part, root));
    }
81978
@Override
    public void _whereBetween(String fieldName, Object start, Object end, boolean exact) {
        fieldName = ensureValidFieldName(fieldName, false);

        List<QueryToken> tokens = getCurrentWhereTokens();
        appendOperatorIfNeeded(tokens);
        negateIfNeeded(tokens, fieldName);

        WhereParams startParams = new WhereParams();
        startParams.setValue(start);
        startParams.setFieldName(fieldName);

        WhereParams endParams = new WhereParams();
        endParams.setValue(end);
        endParams.setFieldName(fieldName);

        String fromParameterName = addQueryParameter(start == null ? "*" : transformValue(startParams, true));
        String toParameterName = addQueryParameter(end == null ? "NULL" : transformValue(endParams, true));

        WhereToken whereToken = WhereToken.create(WhereOperator.BETWEEN, fieldName, null, new WhereToken.WhereOptions(exact, fromParameterName, toParameterName));
        tokens.add(whereToken);
    }
126358
public Where<T, ID> and() {
		ManyClause clause = new ManyClause(pop("AND"), ManyClause.AND_OPERATION);
		push(clause);
		addNeedsFuture(clause);
		return this;
	}
1283258
public static String getQuery(String clazzFieldName, String clazzName, String idFieldName, Object idFieldValue,
            String entityClazz)
    {
        StringBuffer sb = new StringBuffer("+");
        sb.append(clazzFieldName);
        sb.append(":");
        sb.append(clazzName);
        sb.append(" AND ");
        sb.append("+");
        sb.append(idFieldName);
        sb.append(":");
        sb.append(idFieldValue);
        if (entityClazz != null)
        {
            sb.append(" AND ");
            sb.append("+");
            sb.append(IndexingConstants.ENTITY_CLASS_FIELD);
            sb.append(":");
            sb.append(entityClazz);
        }
        return sb.toString();
    }
1313021
private MatchingPart createEmoPermissionPart(String part, PartType partType) {
        part = unescapeSeparators(part);

        // Superclass guarantees part will be non-empty; no need to validate length prior to evaluating the first character
        switch (part.charAt(0)) {
            case 'c':
                // "createTable" only applies to table resource parts
                if (isTableResource(partType) && part.startsWith("createTable(") && part.endsWith(")")) {
                    String rison = part.substring(12, part.length() - 1);
                    return RisonHelper.fromORison(rison, CreateTablePart.class);
                }
                break;

            case 'i':
                if (part.startsWith("if(") && part.endsWith(")")) {
                    String condition = part.substring(3, part.length() - 1);
                    switch (partType) {
                        case SOR_TABLE:
                            return new SorTableConditionPart(Conditions.fromString(condition), _dataStore);
                        case BLOB_TABLE:
                            return new BlobTableConditionPart(Conditions.fromString(condition), _blobStore);
                        default:
                            return new ConditionPart(Conditions.fromString(condition));
                    }
                }
                break;

            case '*':
                if (part.length() == 1) {
                    // This is a pure wildcard
                    return getAnyPart();
                }
                break;

            case '?':
                if (part.length() == 1) {
                    // This is an "implied part exists" check
                    return EmoImpliedPartExistsPart.instance();
                }
                break;

        }

        // All other strings shortcuts for either a resource name or a wildcard expression for matching the name.
        Condition condition = Conditions.like(part);
        if (condition instanceof EqualCondition) {
            return new EmoConstantPart(part);
        }

        return new ConditionPart(condition);
    }
581733
private static void generateAllCombinations(
      List<Filter> result,
      List<Filter> andList,
      List<Filter> nonAndList
  )
  {
    List<Filter> children = ((AndFilter) andList.get(0)).getFilters();
    if (result.isEmpty()) {
      for (Filter child : children) {
        List<Filter> a = Lists.newArrayList(nonAndList);
        a.add(child);
        result.add(new OrFilter(a));
      }
    } else {
      List<Filter> work = new ArrayList<>(result);
      result.clear();
      for (Filter child : children) {
        for (Filter or : work) {
          List<Filter> a = Lists.newArrayList((((OrFilter) or).getFilters()));
          a.add(child);
          result.add(new OrFilter(a));
        }
      }
    }
    if (andList.size() > 1) {
      generateAllCombinations(result, andList.subList(1, andList.size()), nonAndList);
    }
  }
614713
protected static void buildTree(EndpointPart parent, String[] parts, int index, String endpointType) {
        // Check if operation qualifier is part of last element
        String name = parts[index];
        String qualifier = null;

        if (index == parts.length - 1) {
            qualifier = EndpointUtil.decodeEndpointOperation(parts[index], false);
            name = EndpointUtil.decodeEndpointURI(parts[index]);
        }

        // Check if part is defined in the parent
        EndpointPart child = parent.addChild(name);

        if (index < parts.length - 1) {
            buildTree(child, parts, index + 1, endpointType);
        } else {
            // Check if part has an operation qualifier
            if (qualifier != null) {
                child = child.addChild(qualifier);
                child.setQualifier(true);
            }
            child.setEndpointType(endpointType);
        }
    }
670434
public QueryBuilder unionAll() {
        this.firstQuery = query();
        this.firstQuerySetOperation = Operation.UNION;
        this.firstQueryAll = true;
        clear(false);
        return this;
    }
362005
public SqlBuilder query(Query query) {
		return this.select(query.getFields()).from(query.getTableNames()).where(LogicalOperator.AND, query.getWhere());
	}
836565
@Override
    public Predicate and(Expression<Boolean> arg0, Expression<Boolean> arg1)
    {
        if (arg0 != null && arg1 != null)
        {
           return new ConjuctionPredicate((Predicate)arg0, (Predicate)arg1);
        }
        return null;
    }
914158
@Override
    public Part getPart(String arg0) throws IOException, ServletException {
        try {
            collaborator.preInvoke(componentMetaData);
            return request.getPart(arg0);
        } finally {
            collaborator.postInvoke();
        }
    }
671497
@SafeVarargs
    public static final <T> Predicate<T> and(Predicate<T>... predicates) {
        return Seq.of(predicates).reduce(t -> true, (t1, t2) -> t1.and(t2));
    }
662855
function QueryBuilder(client) {
  this.client = client;
  this.and = this;
  this._single = {};
  this._statements = [];

  // Internal flags used in the builder.
  this._method = 'select';
  this._joinFlag = 'inner';
  this._boolFlag = 'and';
  this._notFlag = false;
}
1017019
public QueryBuilder intersect() {
        this.firstQuery = query();
        this.firstQuerySetOperation = Operation.INTERSECT;
        this.firstQueryAll = false;
        clear(false);
        return this;
    }
1063069
private Result runOnLocalPartitions(Query query) {
        PartitionIdSet mutablePartitionIds = getLocalPartitionIds();

        Result result = doRunOnQueryThreads(query, mutablePartitionIds, LOCAL_NODE);
        if (isResultFromAnyPartitionMissing(mutablePartitionIds)) {
            doRunOnPartitionThreads(query, mutablePartitionIds, result);
        }
        assertAllPartitionsQueried(mutablePartitionIds);

        return result;
    }
633664
@SafeVarargs
	public static<T> Filter<T> and(final Filter<T>... f) {
		return new Filter<T>() {
			@Override
			public boolean apply(final T x) {
				for (final Filter<T> filter: f) if (! filter.apply(x)) return false;
				return true;
			}

			@Override
			public String toString() {
				return "(" + StringUtils.join(f, " and ") + ")";
			}

			@Override
			public Filter<T> copy() {
				return Filters.and(Filters.copy(f));
			}
		};
	}
617332
def And(*predicates, **kwargs):
    
    if kwargs:
        predicates += Query(**kwargs),
    return _flatten(_And, *predicates)