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.common;
017
018import org.gbif.api.vocabulary.Rank;
019
020import javax.annotation.Nullable;
021
022/**
023 * A flat taxonomic classification using the major, Linnean ranks with verbatim names.
024 */
025public interface LinneanClassification {
026
027  /**
028   * Return the class for this usage. If the usage is for something above the "class" taxonomic level,
029   * return null.
030   *
031   * @return the class
032   */
033  @Nullable
034  String getClazz();
035
036  /**
037   * @param clazz the clazz to set
038   */
039  void setClazz(String clazz);
040
041  /**
042   * Return the family for this usage. If the usage is for something above the "family" taxonomic level,
043   * return null.
044   *
045   * @return the family
046   */
047  @Nullable
048  String getFamily();
049
050  /**
051   * @param family the family to set
052   */
053  void setFamily(String family);
054
055  /**
056   * Return the genus for this usage. If the usage is for something above the "genus" taxonomic level,
057   * return null.
058   *
059   * @return the genus
060   */
061  @Nullable
062  String getGenus();
063
064  /**
065   * @param genus the genus to set
066   */
067  void setGenus(String genus);
068
069  /**
070   * Return the kingdom for this usage. If the usage is for something above the "kingdom" taxonomic level,
071   * return null.
072   *
073   * @return the kingdom
074   */
075  @Nullable
076  String getKingdom();
077
078  /**
079   * @param kingdom the kingdom to set
080   */
081  void setKingdom(String kingdom);
082
083  /**
084   * Return the order for this usage. If the usage is for something above the "order" taxonomic level,
085   * return null.
086   *
087   * @return the order
088   */
089  @Nullable
090  String getOrder();
091
092  /**
093   * @param order the order to set
094   */
095  void setOrder(String order);
096
097  /**
098   * Return the phylum for this usage. If the usage is for something above the "phylum" taxonomic level,
099   * return null.
100   *
101   * @return the phylum
102   */
103  @Nullable
104  String getPhylum();
105
106  /**
107   * @param phylum the phylum to set
108   */
109  void setPhylum(String phylum);
110
111  /**
112   * Return the species for this usage. If the usage is for something above the "species" taxonomic level,
113   * return null.
114   *
115   * @return the species
116   */
117  @Nullable
118  String getSpecies();
119
120  /**
121   * @param species the species to set
122   */
123  void setSpecies(String species);
124
125  /**
126   * Return the canonical subgenus name for this usage.
127   * If the usage is for something above the "subgenus" taxonomic level, return null.
128   *
129   * @return the subgenus name
130   */
131  @Nullable
132  String getSubgenus();
133
134  /**
135   * @param subgenus the subgenus canonical name
136   */
137  void setSubgenus(String subgenus);
138
139  /**
140   * Gets a higher taxon property by passing the rank of it.
141   * Only Linnean ranks are supported.
142   *
143   * @param rank the higher linnean rank to retrieve
144   *
145   * @return the name of the higher taxon or null if rank doesnt exist
146   */
147  @Nullable
148  String getHigherRank(Rank rank);
149}