001    package org.bukkit;
002    
003    import java.util.Map;
004    
005    import com.google.common.collect.Maps;
006    
007    /**
008     * Represents the three different types of Sandstone
009     */
010    public enum SandstoneType {
011        CRACKED(0x0),
012        GLYPHED(0x1),
013        SMOOTH(0x2);
014    
015        private final byte data;
016        private final static Map<Byte, SandstoneType> BY_DATA = Maps.newHashMap();
017    
018        private SandstoneType(final int data) {
019            this.data = (byte) data;
020        }
021    
022        /**
023         * Gets the associated data value representing this type of sandstone
024         *
025         * @return A byte containing the data value of this sandstone type
026         * @deprecated Magic value
027         */
028        @Deprecated
029        public byte getData() {
030            return data;
031        }
032    
033        /**
034         * Gets the type of sandstone with the given data value
035         *
036         * @param data Data value to fetch
037         * @return The {@link SandstoneType} representing the given value, or null
038         *     if it doesn't exist
039         * @deprecated Magic value
040         */
041        @Deprecated
042        public static SandstoneType getByData(final byte data) {
043            return BY_DATA.get(data);
044        }
045    
046        static {
047            for (SandstoneType type : values()) {
048                BY_DATA.put(type.data, type);
049            }
050        }
051    }