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 and integer based keys. 024 */ 025public interface LinneanClassificationKeys { 026 027 /** 028 * Return the class key for this usage. If the usage is for something above the "class" taxonomic level, 029 * return null. 030 * 031 * @return the classKey 032 */ 033 @Nullable 034 Integer getClassKey(); 035 036 /** 037 * @param classKey the classKey to set 038 */ 039 void setClassKey(Integer classKey); 040 041 /** 042 * Return the family key for this usage. If the usage is for something above the "family" taxonomic level, 043 * return null. 044 * 045 * @return the familyKey 046 */ 047 @Nullable 048 Integer getFamilyKey(); 049 050 /** 051 * @param familyKey the familyKey to set 052 */ 053 void setFamilyKey(Integer familyKey); 054 055 /** 056 * Return the genus key for this usage. If the usage is for something above the "genus" taxonomic level, 057 * return null. 058 * 059 * @return the genusKey 060 */ 061 @Nullable 062 Integer getGenusKey(); 063 064 /** 065 * @param genusKey the genusKey to set 066 */ 067 void setGenusKey(Integer genusKey); 068 069 /** 070 * Return the kingdom key for this usage. If the usage is for something above the "kingdom" taxonomic level, 071 * return null. 072 * 073 * @return the kingdomKey 074 */ 075 @Nullable 076 Integer getKingdomKey(); 077 078 /** 079 * @param kingdomKey the kingdomKey to set 080 */ 081 void setKingdomKey(Integer kingdomKey); 082 083 /** 084 * Return the order key for this usage. If the usage is for something above the "order" taxonomic level, 085 * return null. 086 * 087 * @return the orderKey 088 */ 089 @Nullable 090 Integer getOrderKey(); 091 092 /** 093 * @param orderKey the orderKey to set 094 */ 095 void setOrderKey(Integer orderKey); 096 097 /** 098 * Return the phylum key for this usage. If the usage is for something above the "phylum" taxonomic level, 099 * return null. 100 * 101 * @return the phylumKey 102 */ 103 @Nullable 104 Integer getPhylumKey(); 105 106 /** 107 * @param phylumKey the phylumKey to set 108 */ 109 void setPhylumKey(Integer phylumKey); 110 111 /** 112 * Return the species key for this usage. If the usage is for something above the "species" taxonomic level, 113 * return null. 114 * 115 * @return the speciesKey 116 */ 117 @Nullable 118 Integer getSpeciesKey(); 119 120 /** 121 * @param speciesKey the speciesKey to set 122 */ 123 void setSpeciesKey(Integer speciesKey); 124 125 /** 126 * Return the subgenus key for this usage. 127 * If the usage is for something above the "subgenus" taxonomic level, return null. 128 * 129 * @return subgenusKey 130 */ 131 @Nullable 132 Integer getSubgenusKey(); 133 134 /** 135 * @param subgenusKey the subgenus usage key 136 */ 137 void setSubgenusKey(Integer subgenusKey); 138 139 /** 140 * Gets a higher taxon key 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 key of the higher taxon or null if rank doesnt exist 146 */ 147 @Nullable 148 Integer getHigherRankKey(Rank rank); 149}