001package ca.uhn.fhir.context.support;
002
003/*
004 * #%L
005 * HAPI FHIR - Core Library
006 * %%
007 * Copyright (C) 2014 - 2021 Smile CDR, Inc.
008 * %%
009 * Licensed under the Apache License, Version 2.0 (the "License");
010 * you may not use this file except in compliance with the License.
011 * You may obtain a copy of the License at
012 *
013 *      http://www.apache.org/licenses/LICENSE-2.0
014 *
015 * Unless required by applicable law or agreed to in writing, software
016 * distributed under the License is distributed on an "AS IS" BASIS,
017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018 * See the License for the specific language governing permissions and
019 * limitations under the License.
020 * #L%
021 */
022
023import org.apache.commons.lang3.builder.EqualsBuilder;
024import org.apache.commons.lang3.builder.HashCodeBuilder;
025
026import java.util.ArrayList;
027import java.util.List;
028
029public class TranslateConceptResults {
030        private List<TranslateConceptResult> myResults;
031        private String myMessage;
032        private boolean myResult;
033
034        public TranslateConceptResults() {
035                super();
036                myResults = new ArrayList<>();
037        }
038
039        public List<TranslateConceptResult> getResults() {
040                return myResults;
041        }
042
043        public void setResults(List<TranslateConceptResult> theResults) {
044                myResults = theResults;
045        }
046
047        public String getMessage() {
048                return myMessage;
049        }
050
051        public void setMessage(String theMessage) {
052                myMessage = theMessage;
053        }
054
055        public boolean getResult() {
056                return myResult;
057        }
058
059        public void setResult(boolean theMatched) {
060                myResult = theMatched;
061        }
062
063        public int size() {
064                return getResults().size();
065        }
066
067        public boolean isEmpty() {
068                return getResults().isEmpty();
069        }
070
071        @Override
072        public boolean equals(Object theO) {
073                if (this == theO) {
074                        return true;
075                }
076
077                if (theO == null || getClass() != theO.getClass()) {
078                        return false;
079                }
080
081                TranslateConceptResults that = (TranslateConceptResults) theO;
082
083                EqualsBuilder b = new EqualsBuilder();
084                b.append(myResults, that.myResults);
085                return b.isEquals();
086        }
087
088        @Override
089        public int hashCode() {
090                HashCodeBuilder b = new HashCodeBuilder(17, 37);
091                b.append(myResults);
092                return b.toHashCode();
093        }
094}