001/*
002 * Licensed under the Apache License, Version 2.0 (the "License");
003 * you may not use this file except in compliance with the License.
004 * You may obtain a copy of the License at
005 *
006 *     http://www.apache.org/licenses/LICENSE-2.0
007 *
008 * Unless required by applicable law or agreed to in writing, software
009 * distributed under the License is distributed on an "AS IS" BASIS,
010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
011 * See the License for the specific language governing permissions and
012 * limitations under the License.
013 */
014package org.gbif.api.model.collections;
015
016import java.util.Objects;
017import java.util.StringJoiner;
018import java.util.UUID;
019
020/** Contains the parameters to create an institution from an organization. */
021public class InstitutionImportParams {
022
023  private UUID organizationKey;
024  private String institutionCode;
025
026  public UUID getOrganizationKey() {
027    return organizationKey;
028  }
029
030  public void setOrganizationKey(UUID organizationKey) {
031    this.organizationKey = organizationKey;
032  }
033
034  public String getInstitutionCode() {
035    return institutionCode;
036  }
037
038  public void setInstitutionCode(String institutionCode) {
039    this.institutionCode = institutionCode;
040  }
041
042  @Override
043  public boolean equals(Object o) {
044    if (this == o) {
045      return true;
046    }
047    if (o == null || getClass() != o.getClass()) {
048      return false;
049    }
050    InstitutionImportParams that = (InstitutionImportParams) o;
051    return Objects.equals(organizationKey, that.organizationKey)
052        && Objects.equals(institutionCode, that.institutionCode);
053  }
054
055  @Override
056  public int hashCode() {
057    return Objects.hash(organizationKey, institutionCode);
058  }
059
060  @Override
061  public String toString() {
062    return new StringJoiner(", ", InstitutionImportParams.class.getSimpleName() + "[", "]")
063        .add("organizationKey=" + organizationKey)
064        .add("institutionCode='" + institutionCode + "'")
065        .toString();
066  }
067}