001/*
002 * Copyright 2021 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.dwc.terms;
017
018import java.net.URI;
019
020/**
021 * Terms used in DwC archives from https://plazi.org
022 */
023public enum PlaziTerm implements Term, AlternativeNames {
024  combinationYear,
025  combinationAuthors,
026  basionymYear,
027  basionymAuthors,
028  verbatimScientificName;
029
030  private static final String PREFIX = "plazi";
031  private static final String NS = "http://plazi.org/terms/1.0/";
032  private static final URI NS_URI = URI.create(NS);
033
034  private final boolean isClass;
035  private final String[] alternatives;
036
037  PlaziTerm(boolean isClass, String ... alternatives) {
038    this.alternatives = alternatives;
039    this.isClass = isClass;
040  }
041
042  PlaziTerm(String ... alternatives) {
043    this(false, alternatives);
044  }
045
046  @Override
047  public String simpleName() {
048    return name();
049  }
050
051  @Override
052  public String toString() {
053    return prefixedName();
054  }
055
056  @Override
057  public String[] alternativeNames() {
058    return this.alternatives;
059  }
060
061  @Override
062  public boolean isClass() {
063    return isClass;
064  }
065
066  @Override
067  public String prefix() {
068    return PREFIX;
069  }
070
071  @Override
072  public URI namespace() {
073    return NS_URI;
074  }
075
076}