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
020/**
021 * Enumeration for describing the frequency with which changes and additions are made to the dataset after the initial
022 * dataset is completed. Based on the EML v2.1.1 MaintUpFreqType enumeration.
023 *
024 * @see <a href="http://rs.gbif.org/vocabulary/eml/update_frequency.xml">rs.gbif.org vocabulary</a>
025 * @see <a href="https://knb.ecoinformatics.org/#external//emlparser/docs/eml-2.1.1/./eml-dataset.html#MaintUpFreqType">EML
026 * Enumeration</a>
027 */
028public enum MaintenanceUpdateFrequency {
029  /**
030   * Updated 1 time each day.
031   */
032  DAILY,
033  /**
034   * Updated 1 time each week.
035   */
036  WEEKLY,
037  /**
038   * Updated 1 time each month.
039   */
040  MONTHLY,
041  /**
042   * Updated 2 times each year.
043   */
044  BIANNUALLY,
045  /**
046   * Updated 1 time each year.
047   */
048  ANNUALLY,
049  /**
050   * Updated as needed.
051   */
052  AS_NEEDED,
053  /**
054   * Updated continually.
055   */
056  CONTINUALLY,
057  /**
058   * Updated at irregular intervals.
059   */
060  IRREGULAR,
061  /**
062   * Further updates are not planned.
063   */
064  NOT_PLANNED,
065  /**
066   * Further updates may still happen, but it is not known for sure.
067   * Note: typo matches EML enumeration.
068   * Deprecated - use {@link MaintenanceUpdateFrequency#UNKNOWN} instead.
069   */
070  @Deprecated
071  UNKOWN,
072  /**
073   * Further updates may still happen, but it is not known for sure.
074   */
075  UNKNOWN,
076  /**
077   * Updated according to some other interval.
078   */
079  OTHER_MAINTENANCE_PERIOD;
080
081  /**
082   * @return the matching MaintenanceUpdateFrequency or null
083   */
084  public static MaintenanceUpdateFrequency fromString(String frequency) {
085    return (MaintenanceUpdateFrequency) VocabularyUtils.lookupEnum(frequency, MaintenanceUpdateFrequency.class);
086  }
087}