dev.piste.api.val4j.apis.riotgames.official.enums.RiotShard Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of val4j Show documentation
Show all versions of val4j Show documentation
A Java wrapper for every API associated with VALORANT
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;
};
}
}