001    /*
002     * Copyright 2008 Marc Wick, geonames.org
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     *
016     */
017    package org.geonames;
018    
019    /**
020     * Enumeration for the GeoNames feature classes A,H,L,P,R,S,T,U,V
021     * 
022     * @author marc
023     * 
024     */
025    public enum FeatureClass {
026            /**
027             * Administrative Boundary Features
028             */
029            A,
030            /**
031             * Hydrographic Features
032             */
033            H,
034            /**
035             * Area Features
036             */
037            L,
038            /**
039             * Populated Place Features
040             */
041            P,
042            /**
043             * Road / Railroad Features
044             */
045            R,
046            /**
047             * Spot Features
048             */
049            S,
050            /**
051             * Hypsographic Features
052             */
053            T,
054            /**
055             * Undersea Features
056             */
057            U,
058            /**
059             * Vegetation Features
060             */
061            V;
062    
063            public static FeatureClass fromValue(String value) {
064                    if (value == null || "".equals(value)) {
065                            return null;
066                    }
067                    return valueOf(value);
068            }
069    }