001package ca.uhn.fhir.rest.param;
002
003import ca.uhn.fhir.model.api.IQueryParameterType;
004import ca.uhn.fhir.util.CoverageIgnore;
005
006/*
007 * #%L
008 * HAPI FHIR - Core Library
009 * %%
010 * Copyright (C) 2014 - 2021 Smile CDR, Inc.
011 * %%
012 * Licensed under the Apache License, Version 2.0 (the "License");
013 * you may not use this file except in compliance with the License.
014 * You may obtain a copy of the License at
015 *
016 *      http://www.apache.org/licenses/LICENSE-2.0
017 *
018 * Unless required by applicable law or agreed to in writing, software
019 * distributed under the License is distributed on an "AS IS" BASIS,
020 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
021 * See the License for the specific language governing permissions and
022 * limitations under the License.
023 * #L%
024 */
025
026
027public class CompositeOrListParam<A extends IQueryParameterType, B extends IQueryParameterType>  extends BaseOrListParam<CompositeOrListParam<?,?>, CompositeParam<A,B>> {
028
029        private Class<A> myLeftType;
030        private Class<B> myRightType;
031
032        public CompositeOrListParam(Class<A> theLeftType, Class<B> theRightType) {
033                super();
034                myLeftType = theLeftType;
035                myRightType = theRightType;
036        }
037
038        public Class<A> getLeftType() {
039                return myLeftType;
040        }
041
042        public Class<B> getRightType() {
043                return myRightType;
044        }
045
046        @CoverageIgnore
047        @Override
048        CompositeParam<A,B> newInstance() {
049                return new CompositeParam<A,B>(myLeftType, myRightType);
050        }
051
052        @CoverageIgnore
053        @Override
054        public CompositeOrListParam<A, B> addOr(CompositeParam<A, B> theParameter) {
055                add(theParameter);
056                return this;
057        }
058        
059
060}