001/* 002 * GeoAPI - Java interfaces for OGC/ISO standards 003 * Copyright © 2004-2023 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.distribution; 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 * Name of the medium. 030 * 031 * @deprecated This code list is not anymore part of ISO 19115:2014, since {@code MediumName} has been 032 * replaced by {@link org.opengis.metadata.citation.Citation}. This change may be applied in GeoAPI 4.0. 033 * See <a href="https://github.com/opengeospatial/geoapi/issues/14">issue #14</a>. 034 * 035 * @author Martin Desruisseaux (IRD) 036 * @version 3.1 037 * @since 2.0 038 */ 039@Deprecated(since="3.1") 040@Vocabulary(capacity=18) 041@UML(identifier="MD_MediumNameCode", specification=ISO_19115, version=2003) 042public final class MediumName extends CodeList<MediumName> { 043 /** 044 * Serial number for compatibility with different versions. 045 */ 046 private static final long serialVersionUID = 2634504971646621701L; 047 048 /** 049 * Read-only optical disk. 050 */ 051 @UML(identifier="cdRom", obligation=CONDITIONAL, specification=ISO_19115) 052 public static final MediumName CD_ROM = new MediumName("CD_ROM"); 053 054 /** 055 * Digital versatile disk. 056 */ 057 @UML(identifier="dvd", obligation=CONDITIONAL, specification=ISO_19115) 058 public static final MediumName DVD = new MediumName("DVD"); 059 060 /** 061 * Digital versatile disk digital versatile disk, read only. 062 */ 063 @UML(identifier="dvdRom", obligation=CONDITIONAL, specification=ISO_19115) 064 public static final MediumName DVD_ROM = new MediumName("DVD_ROM"); 065 066 /** 067 * 3½ inch magnetic disk. 068 */ 069 @UML(identifier="3halfInchFloppy", obligation=CONDITIONAL, specification=ISO_19115) 070 public static final MediumName FLOPPY_3_HALF_INCH = new MediumName("FLOPPY_3_HALF_INCH"); 071 072 /** 073 * 5¼ inch magnetic disk. 074 */ 075 @UML(identifier="5quarterInchFloppy", obligation=CONDITIONAL, specification=ISO_19115) 076 public static final MediumName FLOPPY_5_QUARTER_INCH = new MediumName("FLOPPY_5_QUARTER_INCH"); 077 078 /** 079 * 7 track magnetic tape. 080 */ 081 @UML(identifier="7trackTape", obligation=CONDITIONAL, specification=ISO_19115) 082 public static final MediumName TAPE_7_TRACK = new MediumName("TAPE_7_TRACK"); 083 084 /** 085 * 9 track magnetic tape. 086 */ 087 @UML(identifier="9trackTape", obligation=CONDITIONAL, specification=ISO_19115) 088 public static final MediumName TAPE_9_TRACK = new MediumName("TAPE_9_TRACK"); 089 090 /** 091 * 3480 cartridge tape drive. 092 */ 093 @UML(identifier="3480Cartridge", obligation=CONDITIONAL, specification=ISO_19115) 094 public static final MediumName CARTRIDGE_3480 = new MediumName("CARTRIDGE_3480"); 095 096 /** 097 * 3490 cartridge tape drive. 098 */ 099 @UML(identifier="3490Cartridge", obligation=CONDITIONAL, specification=ISO_19115) 100 public static final MediumName CARTRIDGE_3490 = new MediumName("CARTRIDGE_3490"); 101 102 /** 103 * 3580 cartridge tape drive. 104 */ 105 @UML(identifier="3580Cartridge", obligation=CONDITIONAL, specification=ISO_19115) 106 public static final MediumName CARTRIDGE_3580 = new MediumName("CARTRIDGE_3580"); 107 108 /** 109 * 4 millimetre magnetic tape. 110 */ 111 @UML(identifier="4mmCartridgeTape", obligation=CONDITIONAL, specification=ISO_19115) 112 public static final MediumName CARTRIDGE_TAPE_4mm = new MediumName("CARTRIDGE_TAPE_4mm"); 113 114 /** 115 * 8 millimetre magnetic tape. 116 */ 117 @UML(identifier="8mmCartridgeTape", obligation=CONDITIONAL, specification=ISO_19115) 118 public static final MediumName CARTRIDGE_TAPE_8mm = new MediumName("CARTRIDGE_TAPE_8mm"); 119 120 /** 121 * ¼ inch magnetic tape. 122 */ 123 @UML(identifier="1quarterInchCartridgeTape", obligation=CONDITIONAL, specification=ISO_19115) 124 public static final MediumName CARTRIDGE_TAPE_1_QUARTER_INCH = new MediumName("CARTRIDGE_TAPE_1_QUARTER_INCH"); 125 126 /** 127 * Half inch cartridge streaming tape drive. 128 */ 129 @UML(identifier="digitalLinearTape", obligation=CONDITIONAL, specification=ISO_19115) 130 public static final MediumName DIGITAL_LINEAR_TAPE = new MediumName("DIGITAL_LINEAR_TAPE"); 131 132 /** 133 * Direct computer linkage. 134 */ 135 @UML(identifier="onLine", obligation=CONDITIONAL, specification=ISO_19115) 136 public static final MediumName ON_LINE = new MediumName("ON_LINE"); 137 138 /** 139 * Linkage through a satellite communication system. 140 */ 141 @UML(identifier="satellite", obligation=CONDITIONAL, specification=ISO_19115) 142 public static final MediumName SATELLITE = new MediumName("SATELLITE"); 143 144 /** 145 * Communication through a telephone network. 146 */ 147 @UML(identifier="telephoneLink", obligation=CONDITIONAL, specification=ISO_19115) 148 public static final MediumName TELEPHONE_LINK = new MediumName("TELEPHONE_LINK"); 149 150 /** 151 * Pamphlet or leaflet giving descriptive information. 152 */ 153 @UML(identifier="hardcopy", obligation=CONDITIONAL, specification=ISO_19115) 154 public static final MediumName HARDCOPY = new MediumName("HARDCOPY"); 155 156 /** 157 * Constructs an element of the given name. 158 * 159 * @param name the name of the new element. This name shall not be in use by another element of this type. 160 */ 161 private MediumName(final String name) { 162 super(name); 163 } 164 165 /** 166 * Returns the list of {@code MediumName}s. 167 * 168 * @return the list of codes declared in the current JVM. 169 */ 170 public static MediumName[] values() { 171 return values(MediumName.class); 172 } 173 174 /** 175 * Returns the list of codes of the same kind than this code list element. 176 * Invoking this method is equivalent to invoking {@link #values()}, except that 177 * this method can be invoked on an instance of the parent {@code CodeList} class. 178 * 179 * @return all code {@linkplain #values() values} for this code list. 180 */ 181 @Override 182 public MediumName[] family() { 183 return values(); 184 } 185 186 /** 187 * Returns the medium name that matches the given string, or returns a new one if none match it. 188 * This methods returns the first instance (in declaration order) for which the {@linkplain #name() name} 189 * is {@linkplain String#equalsIgnoreCase(String) equals, ignoring case}, to the given name. 190 * If no existing instance is found, then a new one is created for the given name. 191 * 192 * @param code the name of the code to fetch or to create. 193 * @return a code matching the given name. 194 */ 195 public static MediumName valueOf(String code) { 196 return valueOf(MediumName.class, code, MediumName::new).get(); 197 } 198}