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.vocabulary;
017
018import org.gbif.api.util.VocabularyUtils;
019
020import io.swagger.v3.oas.annotations.media.Schema;
021
022/**
023 * <p>An enumeration for all GBIF Regions.  These are based on
024 * <a href="https://www.nature.com/articles/sdata20167/figures/1">IPBES regions</a>.
025 *
026 * <p><em>This is a political division,</em> part of GBIF's governance structure.
027 * For a geographical division, see {@link Continent}.
028 *
029 * @see <a href="https://www.gbif.org/the-gbif-network">The GBIF Network</a>
030 */
031@Schema(
032  description = "An enumeration for all GBIF Regions. These are based on " +
033    "[IPBES regions](https://www.nature.com/articles/sdata20167/figures/1).\n" +
034    "\n" +
035    "*This is a political division,* part of GBIF's governance structure."
036)
037public enum GbifRegion {
038
039  /**
040   * Africa: IPBES regions North Africa, West Africa, Central Africa, East Africa and adjacent islands, Southern Africa.
041   */
042  AFRICA,
043
044  /**
045   * Asia: IPBES regions Western Asia, South Asia, North-East Asia, South-East Asia.
046   */
047  ASIA,
048
049  /**
050   * Europe and Central Asia: IPBES regions Central and Western Europe, Eastern Europe, Central Asia.
051   */
052  EUROPE,
053
054  /**
055   * North America: IPBES region North America.
056   */
057  NORTH_AMERICA,
058
059  /**
060   * Oceania: IPBES region Oceania.
061   */
062  OCEANIA,
063
064  /**
065   * Latin America and the Caribbean: IPBES regions Mesoamerica, Caribbean, South America.
066   */
067  LATIN_AMERICA,
068
069  /**
070   * Antarctica: "Excluded" IPBES regions, or GEO regions except Greenland.  Includes some islands in the Southern Ocean.
071   */
072  ANTARCTICA;
073
074  /**
075   * @param region GBIF's region name
076   *
077   * @return the matching GBIF region or null
078   */
079  public static GbifRegion fromString(String region) {
080    return VocabularyUtils.lookupEnum(region, GbifRegion.class);
081  }
082
083}