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 a collection from a dataset. */ 021public class CollectionImportParams { 022 023 private UUID datasetKey; 024 private String collectionCode; 025 026 public UUID getDatasetKey() { 027 return datasetKey; 028 } 029 030 public void setDatasetKey(UUID datasetKey) { 031 this.datasetKey = datasetKey; 032 } 033 034 public String getCollectionCode() { 035 return collectionCode; 036 } 037 038 public void setCollectionCode(String collectionCode) { 039 this.collectionCode = collectionCode; 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 CollectionImportParams that = (CollectionImportParams) o; 051 return Objects.equals(datasetKey, that.datasetKey) 052 && Objects.equals(collectionCode, that.collectionCode); 053 } 054 055 @Override 056 public int hashCode() { 057 return Objects.hash(datasetKey, collectionCode); 058 } 059 060 @Override 061 public String toString() { 062 return new StringJoiner(", ", CollectionImportParams.class.getSimpleName() + "[", "]") 063 .add("datasetKey=" + datasetKey) 064 .add("collectionCode='" + collectionCode + "'") 065 .toString(); 066 } 067}