001/* 002 * GeoAPI - Java interfaces for OGC/ISO standards 003 * Copyright © 2004-2024 Open Geospatial Consortium, Inc. 004 * http://www.geoapi.org 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); 007 * you may not use this file except in compliance with the License. 008 * You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 015 * See the License for the specific language governing permissions and 016 * limitations under the License. 017 */ 018package org.opengis.metadata.identification; 019 020import org.opengis.util.CodeList; 021import org.opengis.annotation.UML; 022import org.opengis.geoapi.internal.Vocabulary; 023 024import static org.opengis.annotation.Obligation.*; 025import static org.opengis.annotation.Specification.*; 026 027 028/** 029 * Status of the dataset or progress of a review. 030 * 031 * @author Martin Desruisseaux (IRD) 032 * @author Rémi Maréchal (Geomatys) 033 * @version 3.1 034 * @since 2.0 035 */ 036@Vocabulary(capacity=18) 037@UML(identifier="MD_ProgressCode", specification=ISO_19115) 038public final class Progress extends CodeList<Progress> { 039 /** 040 * Serial number for compatibility with different versions. 041 */ 042 private static final long serialVersionUID = 7521085150853319219L; 043 044 /** 045 * Production of the data has been completed. 046 */ 047 @UML(identifier="completed", obligation=CONDITIONAL, specification=ISO_19115) 048 public static final Progress COMPLETED = new Progress("COMPLETED"); 049 050 /** 051 * Data has been stored in an offline storage facility 052 */ 053 @UML(identifier="historicalArchive", obligation=CONDITIONAL, specification=ISO_19115) 054 public static final Progress HISTORICAL_ARCHIVE = new Progress("HISTORICAL_ARCHIVE"); 055 056 /** 057 * Data is no longer relevant. 058 */ 059 @UML(identifier="obsolete", obligation=CONDITIONAL, specification=ISO_19115) 060 public static final Progress OBSOLETE = new Progress("OBSOLETE"); 061 062 /** 063 * Data is continually being updated. 064 */ 065 @UML(identifier="onGoing", obligation=CONDITIONAL, specification=ISO_19115) 066 public static final Progress ON_GOING = new Progress("ON_GOING"); 067 068 /** 069 * Fixed date has been established upon or by which the data will be created or updated. 070 */ 071 @UML(identifier="planned", obligation=CONDITIONAL, specification=ISO_19115) 072 public static final Progress PLANNED = new Progress("PLANNED"); 073 074 /** 075 * Data needs to be generated or updated. 076 */ 077 @UML(identifier="required", obligation=CONDITIONAL, specification=ISO_19115) 078 public static final Progress REQUIRED = new Progress("REQUIRED"); 079 080 /** 081 * Data is currently in the process of being created. 082 */ 083 @UML(identifier="underDevelopment", obligation=CONDITIONAL, specification=ISO_19115) 084 public static final Progress UNDER_DEVELOPMENT = new Progress("UNDER_DEVELOPMENT"); 085 086 /** 087 * Progress concluded and no changes will be accepted. 088 * 089 * @since 3.1 090 */ 091 @UML(identifier="final", obligation=CONDITIONAL, specification=ISO_19115) 092 public static final Progress FINAL = new Progress("FINAL"); 093 094 /** 095 * Committed to, but not yet addressed. 096 * 097 * @since 3.1 098 */ 099 @UML(identifier="pending", obligation=CONDITIONAL, specification=ISO_19115) 100 public static final Progress PENDING = new Progress("PENDING"); 101 102 /** 103 * Item is no longer recommended for use. It has not been superseded by another item. 104 * 105 * @since 3.1 106 */ 107 @UML(identifier="retired", obligation=CONDITIONAL, specification=ISO_19115) 108 public static final Progress RETIRED = new Progress("RETIRED"); 109 110 /** 111 * Replaced by new. 112 * 113 * @since 3.1 114 */ 115 @UML(identifier="superseded", obligation=CONDITIONAL, specification=ISO_19115) 116 public static final Progress SUPERSEDED = new Progress("SUPERSEDED"); 117 118 /** 119 * Provisional changes likely before resource becomes final of complete. 120 * 121 * @since 3.1 122 */ 123 @UML(identifier="tentative", obligation=CONDITIONAL, specification=ISO_19115) 124 public static final Progress TENTATIVE = new Progress("TENTATIVE"); 125 126 /** 127 * Acceptable under specific condition. 128 * 129 * @since 3.1 130 */ 131 @UML(identifier="valid", obligation=CONDITIONAL, specification=ISO_19115) 132 public static final Progress VALID = new Progress("VALID"); 133 134 /** 135 * Agreed to by sponsor. 136 * 137 * @since 3.1 138 */ 139 @UML(identifier="accepted", obligation=CONDITIONAL, specification=ISO_19115) 140 public static final Progress ACCEPTED = new Progress("ACCEPTED"); 141 142 /** 143 * Rejected by sponsor. 144 * 145 * @since 3.1 146 */ 147 @UML(identifier="notAccepted", obligation=CONDITIONAL, specification=ISO_19115) 148 public static final Progress NOT_ACCEPTED = new Progress("NOT_ACCEPTED"); 149 150 /** 151 * Removed from consideration. 152 * 153 * @since 3.1 154 */ 155 @UML(identifier="withdrawn", obligation=CONDITIONAL, specification=ISO_19115) 156 public static final Progress WITHDRAWN = new Progress("WITHDRAWN"); 157 158 /** 159 * Suggested that development needs to be undertaken. 160 * 161 * @since 3.1 162 */ 163 @UML(identifier="proposed", obligation=CONDITIONAL, specification=ISO_19115) 164 public static final Progress PROPOSED = new Progress("PROPOSED"); 165 166 /** 167 * Resource superseded and will become obsolete, use only for historical purposes. 168 * 169 * @since 3.1 170 */ 171 @UML(identifier="deprecated", obligation=CONDITIONAL, specification=ISO_19115) 172 public static final Progress DEPRECATED = new Progress("DEPRECATED"); 173 174 /** 175 * Constructs an element of the given name. 176 * 177 * @param name the name of the new element. This name shall not be in use by another element of this type. 178 */ 179 private Progress(final String name) { 180 super(name); 181 } 182 183 /** 184 * Returns the list of {@code Progress}s. 185 * 186 * @return the list of codes declared in the current JVM. 187 */ 188 public static Progress[] values() { 189 return values(Progress.class); 190 } 191 192 /** 193 * Returns the list of codes of the same kind as this code list element. 194 * Invoking this method is equivalent to invoking {@link #values()}, except that 195 * this method can be invoked on an instance of the parent {@code CodeList} class. 196 * 197 * @return all code {@linkplain #values() values} for this code list. 198 */ 199 @Override 200 public Progress[] family() { 201 return values(); 202 } 203 204 /** 205 * Returns the progress that matches the given string, or returns a new one if none match it. 206 * This methods returns the first instance (in declaration order) for which the {@linkplain #name() name} 207 * is {@linkplain String#equalsIgnoreCase(String) equals, ignoring case}, to the given name. 208 * If no existing instance is found, then a new one is created for the given name. 209 * 210 * @param code the name of the code to fetch or to create. 211 * @return a code matching the given name. 212 */ 213 public static Progress valueOf(String code) { 214 return valueOf(Progress.class, code, Progress::new).get(); 215 } 216}