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

dev.piste.api.val4j.apis.riotgames.official.enums.RiotShard Maven / Gradle / Ivy

There is a newer version: 0.1.33
Show newest version
package dev.piste.api.val4j.apis.riotgames.official.enums;

/**
 * @author Piste
 */
public enum RiotShard {

    NORTH_AMERICA("na"),
    PUBLIC_BETA("pbe"),
    EUROPE("eu"),
    ASIA_PACIFIC("ap"),
    KOREA("kr");

    private final String id;

    RiotShard(String id) {
        this.id = id;
    }

    public String getId() {
        return id;
    }

    public static RiotShard ofId(String id) {
        for (RiotShard riotShard : values()) {
            if (riotShard.getId().equalsIgnoreCase(id)) {
                return riotShard;
            }
        }
        return null;
    }

    public static RiotShard ofRiotRegion(RiotRegion riotRegion) {
        return switch (riotRegion) {
            case EUROPE -> EUROPE;
            case NORTH_AMERICA, LATIN_AMERICA, BRAZIL -> NORTH_AMERICA;
            case KOREA -> KOREA;
            case ASIA_PACIFIC -> ASIA_PACIFIC;
        };
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy