001/* 002 * Copyright 2020 Global Biodiversity Information Facility (GBIF) 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.gbif.api.model.collections.lookup; 017 018import java.net.URI; 019import java.util.Objects; 020import java.util.StringJoiner; 021import java.util.UUID; 022 023public class CollectionMatched extends BaseEntityMatched { 024 025 private UUID institutionKey; 026 private URI institutionLink; 027 private String institutionCode; 028 private String institutionName; 029 030 public UUID getInstitutionKey() { 031 return institutionKey; 032 } 033 034 public void setInstitutionKey(UUID institutionKey) { 035 this.institutionKey = institutionKey; 036 } 037 038 public URI getInstitutionLink() { 039 return institutionLink; 040 } 041 042 public void setInstitutionLink(URI institutionLink) { 043 this.institutionLink = institutionLink; 044 } 045 046 public String getInstitutionCode() { 047 return institutionCode; 048 } 049 050 public void setInstitutionCode(String institutionCode) { 051 this.institutionCode = institutionCode; 052 } 053 054 public String getInstitutionName() { 055 return institutionName; 056 } 057 058 public void setInstitutionName(String institutionName) { 059 this.institutionName = institutionName; 060 } 061 062 @Override 063 public boolean equals(Object o) { 064 if (this == o) { 065 return true; 066 } 067 if (o == null || getClass() != o.getClass()) { 068 return false; 069 } 070 if (!super.equals(o)) { 071 return false; 072 } 073 CollectionMatched that = (CollectionMatched) o; 074 return Objects.equals(institutionKey, that.institutionKey) 075 && Objects.equals(institutionLink, that.institutionLink) 076 && Objects.equals(institutionCode, that.institutionCode) 077 && Objects.equals(institutionName, that.institutionName); 078 } 079 080 @Override 081 public int hashCode() { 082 return Objects.hash( 083 super.hashCode(), institutionKey, institutionLink, institutionCode, institutionName); 084 } 085 086 @Override 087 public String toString() { 088 return new StringJoiner(", ", CollectionMatched.class.getSimpleName() + "[", "]") 089 .add("super=" + super.toString()) 090 .add("institutionKey=" + institutionKey) 091 .add("institutionLink=" + institutionLink) 092 .add("institutionCode='" + institutionCode + "'") 093 .add("institutionName='" + institutionName + "'") 094 .toString(); 095 } 096}