001package ca.uhn.fhir.context.support; 002 003/* 004 * #%L 005 * HAPI FHIR - Core Library 006 * %% 007 * Copyright (C) 2014 - 2022 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; 025import org.apache.commons.lang3.builder.ToStringBuilder; 026import org.apache.commons.lang3.builder.ToStringStyle; 027 028public class TranslateConceptResult { 029 private String mySystem; 030 private String myCode; 031 private String myDisplay; 032 private String myEquivalence; 033 private String myConceptMapUrl; 034 private String myValueSet; 035 private String mySystemVersion; 036 037 /** 038 * Constructor 039 */ 040 public TranslateConceptResult() { 041 super(); 042 } 043 044 public String getSystem() { 045 return mySystem; 046 } 047 048 public TranslateConceptResult setSystem(String theSystem) { 049 mySystem = theSystem; 050 return this; 051 } 052 053 @Override 054 public String toString() { 055 return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE) 056 .append("system", mySystem) 057 .append("code", myCode) 058 .append("display", myDisplay) 059 .append("equivalence", myEquivalence) 060 .append("conceptMapUrl", myConceptMapUrl) 061 .append("valueSet", myValueSet) 062 .append("systemVersion", mySystemVersion) 063 .toString(); 064 } 065 066 public String getCode() { 067 return myCode; 068 } 069 070 public TranslateConceptResult setCode(String theCode) { 071 myCode = theCode; 072 return this; 073 } 074 075 public String getDisplay() { 076 return myDisplay; 077 } 078 079 public TranslateConceptResult setDisplay(String theDisplay) { 080 myDisplay = theDisplay; 081 return this; 082 } 083 084 public String getEquivalence() { 085 return myEquivalence; 086 } 087 088 public TranslateConceptResult setEquivalence(String theEquivalence) { 089 myEquivalence = theEquivalence; 090 return this; 091 } 092 093 public String getSystemVersion() { 094 return mySystemVersion; 095 } 096 097 public void setSystemVersion(String theSystemVersion) { 098 mySystemVersion = theSystemVersion; 099 } 100 101 public String getValueSet() { 102 return myValueSet; 103 } 104 105 public TranslateConceptResult setValueSet(String theValueSet) { 106 myValueSet = theValueSet; 107 return this; 108 } 109 110 public String getConceptMapUrl() { 111 return myConceptMapUrl; 112 } 113 114 public TranslateConceptResult setConceptMapUrl(String theConceptMapUrl) { 115 myConceptMapUrl = theConceptMapUrl; 116 return this; 117 } 118 119 @Override 120 public boolean equals(Object theO) { 121 if (this == theO) { 122 return true; 123 } 124 125 if (theO == null || getClass() != theO.getClass()) { 126 return false; 127 } 128 129 TranslateConceptResult that = (TranslateConceptResult) theO; 130 131 EqualsBuilder b = new EqualsBuilder(); 132 b.append(mySystem, that.mySystem); 133 b.append(myCode, that.myCode); 134 b.append(myDisplay, that.myDisplay); 135 b.append(myEquivalence, that.myEquivalence); 136 b.append(myConceptMapUrl, that.myConceptMapUrl); 137 b.append(myValueSet, that.myValueSet); 138 b.append(mySystemVersion, that.mySystemVersion); 139 return b.isEquals(); 140 } 141 142 @Override 143 public int hashCode() { 144 HashCodeBuilder b = new HashCodeBuilder(17, 37); 145 b.append(mySystem); 146 b.append(myCode); 147 b.append(myDisplay); 148 b.append(myEquivalence); 149 b.append(myConceptMapUrl); 150 b.append(myValueSet); 151 b.append(mySystemVersion); 152 return b.toHashCode(); 153 } 154}