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 org.gbif.api.model.collections.Institution;
019
020import java.util.Objects;
021import java.util.UUID;
022
023public class InstitutionChangeSuggestion extends BaseChangeSuggestion<Institution> {
024
025  private UUID institutionForConvertedCollection;
026  private String nameForNewInstitutionForConvertedCollection;
027
028  public UUID getInstitutionForConvertedCollection() {
029    return institutionForConvertedCollection;
030  }
031
032  public void setInstitutionForConvertedCollection(UUID institutionForConvertedCollection) {
033    this.institutionForConvertedCollection = institutionForConvertedCollection;
034  }
035
036  public String getNameForNewInstitutionForConvertedCollection() {
037    return nameForNewInstitutionForConvertedCollection;
038  }
039
040  public void setNameForNewInstitutionForConvertedCollection(
041      String nameForNewInstitutionForConvertedCollection) {
042    this.nameForNewInstitutionForConvertedCollection = nameForNewInstitutionForConvertedCollection;
043  }
044
045  @Override
046  public boolean equals(Object o) {
047    if (this == o) {
048      return true;
049    }
050    if (o == null || getClass() != o.getClass()) {
051      return false;
052    }
053    if (!super.equals(o)) {
054      return false;
055    }
056    InstitutionChangeSuggestion that = (InstitutionChangeSuggestion) o;
057    return Objects.equals(institutionForConvertedCollection, that.institutionForConvertedCollection)
058        && Objects.equals(
059            nameForNewInstitutionForConvertedCollection,
060            that.nameForNewInstitutionForConvertedCollection);
061  }
062
063  @Override
064  public int hashCode() {
065    return Objects.hash(
066        super.hashCode(),
067        institutionForConvertedCollection,
068        nameForNewInstitutionForConvertedCollection);
069  }
070}