100 lines
3.2 KiB
Java
100 lines
3.2 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* javax.baja.sys.BFrozenEnum
|
|
* javax.baja.sys.Sys
|
|
* javax.baja.sys.Type
|
|
*/
|
|
package com.tridium.platform;
|
|
|
|
import javax.baja.sys.BFrozenEnum;
|
|
import javax.baja.sys.Sys;
|
|
import javax.baja.sys.Type;
|
|
|
|
/*
|
|
* Illegal identifiers - consider using --renameillegalidents true
|
|
*/
|
|
public final class BOperatingSystemEnum
|
|
extends BFrozenEnum {
|
|
public static final int UNKNOWN = -1;
|
|
public static final int WINDOWS = 0;
|
|
public static final int QNX = 1;
|
|
public static final int LINUX = 2;
|
|
public static final int UNSUPPORTED = 3;
|
|
public static final BOperatingSystemEnum unknown = new BOperatingSystemEnum(-1);
|
|
public static final BOperatingSystemEnum windows = new BOperatingSystemEnum(0);
|
|
public static final BOperatingSystemEnum qnx = new BOperatingSystemEnum(1);
|
|
public static final BOperatingSystemEnum linux = new BOperatingSystemEnum(2);
|
|
public static final BOperatingSystemEnum unsupported = new BOperatingSystemEnum(3);
|
|
public static final Type TYPE;
|
|
public static final BOperatingSystemEnum DEFAULT;
|
|
private static BOperatingSystemEnum os;
|
|
static /* synthetic */ Class class$com$tridium$platform$BOperatingSystemEnum;
|
|
|
|
public final Type getType() {
|
|
return TYPE;
|
|
}
|
|
|
|
public static final BOperatingSystemEnum make(int n) {
|
|
return (BOperatingSystemEnum)unknown.getRange().get(n, false);
|
|
}
|
|
|
|
public static final BOperatingSystemEnum make(String string) {
|
|
return (BOperatingSystemEnum)unknown.getRange().get(string);
|
|
}
|
|
|
|
public static final BOperatingSystemEnum getOS() {
|
|
if (os == null) {
|
|
BOperatingSystemEnum.checkOS();
|
|
}
|
|
return os;
|
|
}
|
|
|
|
public static final boolean isOS(BOperatingSystemEnum bOperatingSystemEnum) {
|
|
if (os == null) {
|
|
BOperatingSystemEnum.checkOS();
|
|
}
|
|
boolean bl = false;
|
|
if (bOperatingSystemEnum == os) {
|
|
bl = true;
|
|
}
|
|
return bl;
|
|
}
|
|
|
|
private static final void checkOS() {
|
|
if (os == null) {
|
|
String string = System.getProperty("os.name");
|
|
os = string.toLowerCase().startsWith("l") && string.toLowerCase().endsWith("x") ? linux : (string.toLowerCase().startsWith("win") ? windows : (string.toLowerCase().startsWith("q") && string.toLowerCase().endsWith("x") ? qnx : unsupported));
|
|
}
|
|
}
|
|
|
|
static /* synthetic */ Class class(String string, boolean bl) {
|
|
try {
|
|
Class<?> clazz = Class.forName(string);
|
|
if (!bl) {
|
|
clazz = clazz.getComponentType();
|
|
}
|
|
return clazz;
|
|
}
|
|
catch (ClassNotFoundException classNotFoundException) {
|
|
throw new NoClassDefFoundError(classNotFoundException.getMessage());
|
|
}
|
|
}
|
|
|
|
private BOperatingSystemEnum(int n) {
|
|
super(n);
|
|
}
|
|
|
|
static {
|
|
Class clazz = class$com$tridium$platform$BOperatingSystemEnum;
|
|
if (clazz == null) {
|
|
clazz = class$com$tridium$platform$BOperatingSystemEnum = BOperatingSystemEnum.class("[Lcom.tridium.platform.BOperatingSystemEnum;", false);
|
|
}
|
|
TYPE = Sys.loadType((Class)clazz);
|
|
DEFAULT = unknown;
|
|
os = null;
|
|
}
|
|
}
|
|
|