001package ca.uhn.fhir.rest.gclient;
002
003import ca.uhn.fhir.model.api.IQueryParameterType;
004
005import java.util.List;
006import java.util.Map;
007
008/*
009 * #%L
010 * HAPI FHIR - Core Library
011 * %%
012 * Copyright (C) 2014 - 2021 Smile CDR, Inc.
013 * %%
014 * Licensed under the Apache License, Version 2.0 (the "License");
015 * you may not use this file except in compliance with the License.
016 * You may obtain a copy of the License at
017 *
018 *      http://www.apache.org/licenses/LICENSE-2.0
019 *
020 * Unless required by applicable law or agreed to in writing, software
021 * distributed under the License is distributed on an "AS IS" BASIS,
022 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
023 * See the License for the specific language governing permissions and
024 * limitations under the License.
025 * #L%
026 */
027
028public interface IBaseQuery<T extends IBaseQuery<?>> {
029
030        /**
031         * Add a search parameter to the query.
032         * <p>
033         * Note that this method is a synonym for {@link #where(ICriterion)}, and is only
034         * here to make fluent queries read more naturally.
035         * </p>
036         */
037        T and(ICriterion<?> theCriterion);
038
039        /**
040         * Add a set of search parameters to the query.
041         *
042         * Note that the entries of the map are extracted immediately upon invoking this method. Changes made to the
043         * map afterward will not be reflected in the actual search.
044         */
045        T where(Map<String, List<IQueryParameterType>> theCriterion);
046
047        /**
048         * Add a search parameter to the query.
049         */
050        T where(ICriterion<?> theCriterion);
051
052        /**
053         * Add a set of search parameters to the query.
054         * <p>
055         * Values will be treated semi-literally. No FHIR escaping will be performed
056         * on the values, but regular URL escaping will be.
057         * </p>
058         */
059        T whereMap(Map<String, List<String>> theRawMap);
060
061}