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.registry.eml; 017 018import java.io.Serializable; 019import java.util.ArrayList; 020import java.util.List; 021import java.util.Objects; 022import java.util.StringJoiner; 023 024public class SamplingDescription implements Serializable { 025 026 private static final long serialVersionUID = -9075523119279155795L; 027 028 private String studyExtent; 029 030 private String sampling; 031 private String qualityControl; 032 private List<String> methodSteps = new ArrayList<>(); 033 034 public SamplingDescription() { 035 } 036 037 public SamplingDescription(String studyExtent, String sampling, String qualityControl, List<String> methodSteps) { 038 this.studyExtent = studyExtent; 039 this.sampling = sampling; 040 this.qualityControl = qualityControl; 041 this.methodSteps = methodSteps; 042 } 043 044 public List<String> getMethodSteps() { 045 return methodSteps; 046 } 047 048 public void setMethodSteps(List<String> methodSteps) { 049 this.methodSteps = methodSteps; 050 } 051 052 public void addMethodStep(String methodStep) { 053 this.methodSteps.add(methodStep); 054 } 055 056 public String getQualityControl() { 057 return qualityControl; 058 } 059 060 public void setQualityControl(String qualityControl) { 061 this.qualityControl = qualityControl; 062 } 063 064 public String getSampling() { 065 return sampling; 066 } 067 068 public void setSampling(String sampling) { 069 this.sampling = sampling; 070 } 071 072 public String getStudyExtent() { 073 return studyExtent; 074 } 075 076 public void setStudyExtent(String studyExtent) { 077 this.studyExtent = studyExtent; 078 } 079 080 @Override 081 public boolean equals(Object o) { 082 if (this == o) { 083 return true; 084 } 085 if (o == null || getClass() != o.getClass()) { 086 return false; 087 } 088 SamplingDescription that = (SamplingDescription) o; 089 return Objects.equals(studyExtent, that.studyExtent) && 090 Objects.equals(sampling, that.sampling) && 091 Objects.equals(qualityControl, that.qualityControl) && 092 Objects.equals(methodSteps, that.methodSteps); 093 } 094 095 @Override 096 public int hashCode() { 097 return Objects.hash(studyExtent, sampling, qualityControl, methodSteps); 098 } 099 100 @Override 101 public String toString() { 102 return new StringJoiner(", ", SamplingDescription.class.getSimpleName() + "[", "]") 103 .add("studyExtent='" + studyExtent + "'") 104 .add("sampling='" + sampling + "'") 105 .add("qualityControl='" + qualityControl + "'") 106 .add("methodSteps=" + methodSteps) 107 .toString(); 108 } 109}