forked from GeyserMC/Geyser
Add friendly display names for DeviceOS (#477)
This commit is contained in:
parent
d0a2f6ac27
commit
da02989967
1 changed files with 28 additions and 14 deletions
|
@ -30,24 +30,38 @@ import com.fasterxml.jackson.annotation.JsonEnumDefaultValue;
|
||||||
public enum DeviceOS {
|
public enum DeviceOS {
|
||||||
|
|
||||||
@JsonEnumDefaultValue
|
@JsonEnumDefaultValue
|
||||||
UNKNOWN,
|
UNKNOWN("Unknown"),
|
||||||
ANDROID,
|
ANDROID("Android"),
|
||||||
IOS,
|
IOS("iOS"),
|
||||||
OSX,
|
OSX("macOS"),
|
||||||
FIREOS,
|
FIREOS("FireOS"),
|
||||||
GEARVR,
|
GEARVR("Gear VR"),
|
||||||
HOLOLENS,
|
HOLOLENS("Hololens"),
|
||||||
WIN10,
|
WIN10("Windows 10"),
|
||||||
WIN32,
|
WIN32("Windows"),
|
||||||
DEDICATED,
|
DEDICATED("Dedicated"),
|
||||||
ORBIS,
|
ORBIS("PS4"),
|
||||||
NX,
|
NX("Switch"),
|
||||||
SWITCH,
|
SWITCH("Switch"),
|
||||||
XBOX_ONE;
|
XBOX_ONE("Xbox One");
|
||||||
|
|
||||||
private static final DeviceOS[] VALUES = values();
|
private static final DeviceOS[] VALUES = values();
|
||||||
|
|
||||||
|
private final String displayName;
|
||||||
|
|
||||||
|
DeviceOS(final String displayName) {
|
||||||
|
this.displayName = displayName;
|
||||||
|
}
|
||||||
|
|
||||||
public static DeviceOS getById(int id) {
|
public static DeviceOS getById(int id) {
|
||||||
return id < VALUES.length ? VALUES[id] : VALUES[0];
|
return id < VALUES.length ? VALUES[id] : VALUES[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return friendly display name of platform.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return displayName;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue