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.suggestions; 017 018import java.util.Objects; 019 020import lombok.Getter; 021import lombok.Setter; 022 023import org.gbif.api.model.collections.Collection; 024 025@Getter 026@Setter 027public class CollectionChangeSuggestion extends BaseChangeSuggestion<Collection> { 028 029 private String ihIdentifier; 030 031 private Boolean createInstitution; 032 033 @Override 034 public boolean equals(Object o) { 035 if (this == o) { 036 return true; 037 } 038 if (o == null || getClass() != o.getClass()) { 039 return false; 040 } 041 if (!super.equals(o)) { 042 return false; 043 } 044 CollectionChangeSuggestion that = (CollectionChangeSuggestion) o; 045 return Objects.equals(ihIdentifier, that.ihIdentifier) 046 && Objects.equals(createInstitution, that.createInstitution); 047 } 048 049 @Override 050 public int hashCode() { 051 return Objects.hash( 052 super.hashCode(), 053 ihIdentifier, 054 createInstitution); 055 } 056 057 @Override 058 public String toString() { 059 return "CollectionChangeSuggestion{" + 060 "ihIdentifier='" + ihIdentifier + '\'' + 061 ", createInstitution=" + createInstitution + 062 ", key=" + getKey() + 063 ", type=" + getType() + 064 ", status=" + getStatus() + 065 ", entityKey=" + getEntityKey() + 066 ", entityName='" + getEntityName() + '\'' + 067 ", entityCountry=" + getEntityCountry() + 068 ", suggestedEntity=" + getSuggestedEntity() + 069 ", proposed=" + getProposed() + 070 ", proposedBy='" + getProposedBy() + '\'' + 071 ", proposerEmail='" + getProposerEmail() + '\'' + 072 ", applied=" + getApplied() + 073 ", appliedBy='" + getAppliedBy() + '\'' + 074 ", discarded=" + getDiscarded() + 075 ", discardedBy='" + getDiscardedBy() + '\'' + 076 ", comments=" + getComments() + 077 ", mergeTargetKey=" + getMergeTargetKey() + 078 ", changes=" + getChanges() + 079 ", modified=" + getModified() + 080 ", modifiedBy='" + getModifiedBy() + '\'' + 081 '}'; 082 } 083}