001/*-
002 * #%L
003 * HAPI FHIR - Master Data Management
004 * %%
005 * Copyright (C) 2014 - 2024 Smile CDR, Inc.
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package ca.uhn.fhir.mdm.model.mdmevents;
021
022import ca.uhn.fhir.mdm.api.MdmLinkSourceEnum;
023import ca.uhn.fhir.mdm.api.MdmMatchResultEnum;
024import ca.uhn.fhir.model.api.IModelJson;
025import com.fasterxml.jackson.annotation.JsonProperty;
026
027import java.util.Date;
028import java.util.Objects;
029
030public class MdmLinkJson implements IModelJson {
031
032        @JsonProperty("goldenResourceId")
033        private String myGoldenResourceId;
034
035        @JsonProperty("sourceId")
036        private String mySourceId;
037
038        @JsonProperty("matchResult")
039        private MdmMatchResultEnum myMatchResult;
040
041        @JsonProperty("linkSource")
042        private MdmLinkSourceEnum myLinkSource;
043
044        @JsonProperty("created")
045        private Date myCreated;
046
047        @JsonProperty("updated")
048        private Date myUpdated;
049
050        @JsonProperty("version")
051        private String myVersion;
052
053        /**
054         * This link was created as a result of an eid match
055         **/
056        @JsonProperty("eidMatch")
057        private Boolean myEidMatch;
058
059        /**
060         * This link created a new golden resource
061         **/
062        @JsonProperty("linkCreatedNewGoldenResource")
063        private Boolean myLinkCreatedNewResource;
064
065        @JsonProperty("vector")
066        private Long myVector;
067
068        @JsonProperty("score")
069        private Double myScore;
070
071        @JsonProperty("ruleCount")
072        private Long myRuleCount;
073
074        public String getGoldenResourceId() {
075                return myGoldenResourceId;
076        }
077
078        public MdmLinkJson setGoldenResourceId(String theGoldenResourceId) {
079                myGoldenResourceId = theGoldenResourceId;
080                return this;
081        }
082
083        public String getSourceId() {
084                return mySourceId;
085        }
086
087        public MdmLinkJson setSourceId(String theSourceId) {
088                mySourceId = theSourceId;
089                return this;
090        }
091
092        public MdmMatchResultEnum getMatchResult() {
093                return myMatchResult;
094        }
095
096        public MdmLinkJson setMatchResult(MdmMatchResultEnum theMatchResult) {
097                myMatchResult = theMatchResult;
098                return this;
099        }
100
101        public MdmLinkSourceEnum getLinkSource() {
102                return myLinkSource;
103        }
104
105        public MdmLinkJson setLinkSource(MdmLinkSourceEnum theLinkSource) {
106                myLinkSource = theLinkSource;
107                return this;
108        }
109
110        public Date getCreated() {
111                return myCreated;
112        }
113
114        public MdmLinkJson setCreated(Date theCreated) {
115                myCreated = theCreated;
116                return this;
117        }
118
119        public Date getUpdated() {
120                return myUpdated;
121        }
122
123        public MdmLinkJson setUpdated(Date theUpdated) {
124                myUpdated = theUpdated;
125                return this;
126        }
127
128        public String getVersion() {
129                return myVersion;
130        }
131
132        public MdmLinkJson setVersion(String theVersion) {
133                myVersion = theVersion;
134                return this;
135        }
136
137        public Boolean getEidMatch() {
138                return myEidMatch;
139        }
140
141        public MdmLinkJson setEidMatch(Boolean theEidMatch) {
142                myEidMatch = theEidMatch;
143                return this;
144        }
145
146        public Boolean getLinkCreatedNewResource() {
147                return myLinkCreatedNewResource;
148        }
149
150        public MdmLinkJson setLinkCreatedNewResource(Boolean theLinkCreatedNewResource) {
151                myLinkCreatedNewResource = theLinkCreatedNewResource;
152                return this;
153        }
154
155        public Long getVector() {
156                return myVector;
157        }
158
159        public MdmLinkJson setVector(Long theVector) {
160                myVector = theVector;
161                return this;
162        }
163
164        public Double getScore() {
165                return myScore;
166        }
167
168        public MdmLinkJson setScore(Double theScore) {
169                myScore = theScore;
170                return this;
171        }
172
173        public Long getRuleCount() {
174                return myRuleCount;
175        }
176
177        public void setRuleCount(Long theRuleCount) {
178                myRuleCount = theRuleCount;
179        }
180
181        @Override
182        public boolean equals(Object theO) {
183                if (this == theO) return true;
184                if (theO == null || getClass() != theO.getClass()) return false;
185                final MdmLinkJson that = (MdmLinkJson) theO;
186                return Objects.equals(myGoldenResourceId, that.myGoldenResourceId)
187                                && Objects.equals(mySourceId, that.mySourceId)
188                                && myMatchResult == that.myMatchResult
189                                && myLinkSource == that.myLinkSource
190                                && Objects.equals(myCreated, that.myCreated)
191                                && Objects.equals(myUpdated, that.myUpdated)
192                                && Objects.equals(myVersion, that.myVersion)
193                                && Objects.equals(myEidMatch, that.myEidMatch)
194                                && Objects.equals(myLinkCreatedNewResource, that.myLinkCreatedNewResource)
195                                && Objects.equals(myVector, that.myVector)
196                                && Objects.equals(myScore, that.myScore)
197                                && Objects.equals(myRuleCount, that.myRuleCount);
198        }
199
200        @Override
201        public int hashCode() {
202                return Objects.hash(
203                                myGoldenResourceId,
204                                mySourceId,
205                                myMatchResult,
206                                myLinkSource,
207                                myCreated,
208                                myUpdated,
209                                myVersion,
210                                myEidMatch,
211                                myLinkCreatedNewResource,
212                                myVector,
213                                myScore,
214                                myRuleCount);
215        }
216
217        @Override
218        public String toString() {
219                return "MdmLinkJson{" + "myGoldenResourceId='"
220                                + myGoldenResourceId + '\'' + ", mySourceId='"
221                                + mySourceId + '\'' + ", myMatchResult="
222                                + myMatchResult + ", myLinkSource="
223                                + myLinkSource + ", myCreated="
224                                + myCreated + ", myUpdated="
225                                + myUpdated + ", myVersion='"
226                                + myVersion + '\'' + ", myEidMatch="
227                                + myEidMatch + ", myLinkCreatedNewResource="
228                                + myLinkCreatedNewResource + ", myVector="
229                                + myVector + ", myScore="
230                                + myScore + ", myRuleCount="
231                                + myRuleCount + '}';
232        }
233}