001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2024 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.fhirgw.model;
011
012import com.google.common.collect.ArrayListMultimap;
013import com.google.common.collect.Multimap;
014import com.google.common.collect.Multimaps;
015
016import java.util.Arrays;
017
018public class SearchPageRequest extends BaseRequest<SearchPageRequest> {
019        private String myRequestPath;
020        private Multimap<String, String> myParameters = EMPTY_STRING_MULTIMAP;
021
022        /**
023         * Constructor
024         */
025        public SearchPageRequest() {
026                // nothing
027        }
028
029        /**
030         * Copy constructor
031         */
032        public SearchPageRequest(SearchPageRequest theRequest) {
033                super(theRequest);
034                myRequestPath = theRequest.getRequestPath();
035                myParameters = ArrayListMultimap.create(theRequest.getRequestParameters());
036        }
037
038        public String getRequestPath() {
039                return myRequestPath;
040        }
041
042        public void setRequestPath(String theRequestPath) {
043                myRequestPath = theRequestPath;
044        }
045
046        public Multimap<String, String> getRequestParameters() {
047                return Multimaps.unmodifiableMultimap(myParameters);
048        }
049
050        public void addRequestParameters(String theName, String[] theValues) {
051                if (myParameters.isEmpty()) {
052                        myParameters = ArrayListMultimap.create();
053                }
054                myParameters.putAll(theName, Arrays.asList(theValues));
055        }
056}