All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nls.util.Regions Maven / Gradle / Ivy

There is a newer version: 1.0.14
Show newest version
package com.nls.util;

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

public final class Regions {
    public enum Name {
        NorthAmerica,
        SouthAmerica,
        Europe,
        AfricaAndMiddleEast,
        AsiaPacific
    }

    private static final Map REGION_MAP = build();

    private Regions() {

    }

    private static Map build() {
        Map map = new HashMap<>();
        map.put(Name.NorthAmerica, new Region(Name.NorthAmerica, "North America",
                "USA", "CAN"));
        map.put(Name.SouthAmerica, new Region(Name.SouthAmerica, "South America",
                "BRA"));
        map.put(Name.Europe, new Region(Name.Europe, "Europe",
                "GBR", "AUT", "BEL", "FRA", "DEU", "IRL", "ITA", "POL",
                "PRT", "ESP", "CHE"));
        map.put(Name.AfricaAndMiddleEast, new Region(Name.AfricaAndMiddleEast, "Africa & Middle East",
                "KEN", "MAR", "NGA", "SAU", "ZAF", "ARE", "MOZ", "NAM", "TZA", "ZWE", "ZMB"));
        map.put(Name.AsiaPacific, new Region(Name.AsiaPacific, "Asia Pacific",
                "AUS", "CHN", "HKG", "IDN", "MYS", "PHL", "SGP", "THA"));

        return Collections.unmodifiableMap(map);
    }

    public static Region get(Name name) {
        return REGION_MAP.get(name);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy