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.vocabulary; 015 016import io.swagger.v3.oas.annotations.ExternalDocumentation; 017import io.swagger.v3.oas.annotations.media.Schema; 018 019/** 020 * A statement about the presence or absence of an occurrence at a location at a time. 021 * 022 * @see <a href="https://rs.gbif.org/vocabulary/gbif/occurrence_status/">rs.gbif.org vocabulary</a> 023 */ 024@Schema( 025 description = "A statement about whether a Taxon was detected at a Location.\n\n" + 026 "For definitions, see the [GBIF occurrence status vocabulary](https://rs.gbif.org/vocabulary/gbif/occurrence_status/).", 027 externalDocs = @ExternalDocumentation( 028 description = "Darwin Core definition", 029 url = "https://rs.tdwg.org/dwc/terms/occurrenceStatus" 030 ) 031)public enum OccurrenceStatus { 032 @Deprecated 033 PRESENT, 034 @Deprecated 035 ABSENT, 036 DETECTED, 037 NOT_DETECTED; 038 039 /** 040 * Maps deprecated aliases to the current terms: {@link #PRESENT}→{@link #DETECTED}, 041 * {@link #ABSENT}→{@link #NOT_DETECTED}. 042 */ 043 public OccurrenceStatus normalize() { 044 if (this == ABSENT || this == NOT_DETECTED) { 045 return NOT_DETECTED; 046 } 047 return DETECTED; 048 } 049}