aboutsummaryrefslogtreecommitdiffstats
path: root/src/cgeo/geocaching/enumerations/CacheSize.java
blob: 9ea82bb6bf6198a30225c3623ee2d23bf70967dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package cgeo.geocaching.enumerations;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/**
 * Enum listing cache sizes
 * 
 * @author koem
 */
public enum CacheSize {
    MICRO("micro", 1),
    SMALL("small", 2),
    REGULAR("regular", 3),
    LARGE("large", 4),
    NOT_CHOSEN("not chosen", 0),
    OTHER("other", 0);

    public final String cgeoId;
    public final int comparable;

    private CacheSize(String cgeoId, int comparable) {
        this.cgeoId = cgeoId;
        this.comparable = comparable;
    }

    final public static Map<String, CacheSize> FIND_BY_CGEOID;
    static {
        final HashMap<String, CacheSize> mapping = new HashMap<String, CacheSize>();
        for (CacheSize cs : values()) {
            mapping.put(cs.cgeoId, cs);
        }
        FIND_BY_CGEOID = Collections.unmodifiableMap(mapping);
    }

}