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.service.checklistbank;
017
018import org.gbif.api.model.checklistbank.Description;
019import org.gbif.api.model.checklistbank.TableOfContents;
020
021import javax.annotation.Nullable;
022
023/**
024 * Service interface for Description Interface methods. This is the public interface
025 * providing methods for retrieving Description.
026 * These methods will for the most part return a Description object.
027 *
028 * @see Description
029 */
030public interface DescriptionService extends NameUsageExtensionService<Description> {
031
032  /**
033   * Returns a table of content for all available descriptions of a name usage.
034   * @param taxonKey the name usage key
035   */
036  TableOfContents getToc(int taxonKey);
037
038  /**
039   * Retrieve a description by its key.
040   * The portal species pages rely on this method to asynchroneously load species descriptions.
041   *
042   * @param key     that identifies a description
043   */
044  @Nullable
045  Description get(int key);
046
047}