Package adams.core.management
Class OS
- java.lang.Object
-
- adams.core.management.OS
-
public class OS extends Object
Helper class for operating system related stuff.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOS.OperatingSystemsEnumeration of OS.
-
Field Summary
Fields Modifier and Type Field Description protected static Booleanm_IsAndroidwhether the OS is Android.protected static Booleanm_IsArm64whether the architecture is arm64.protected static Booleanm_IsLinuxwhether the OS is Linux.protected static Booleanm_IsMacwhether the OS is Mac.protected static Booleanm_IsWindowswhether the OS is Windows.
-
Constructor Summary
Constructors Constructor Description OS()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intgetBitness()Returns the "bitness", ie 32 or 64 bit of the underlying OS.static booleanisAndroid()Checks whether the operating system is Android.static booleanisArm64()Checks whether the architecture is arm64.static booleanisLinux()Checks whether the operating system is Linux (but not Android).static booleanisMac()Checks whether the operating system is Mac.static booleanisOS(OS.OperatingSystems os)Tests whether the current OS is the same as the provided parameter.static booleanisWindows()Checks whether the operating system is Windows.
-
-
-
Field Detail
-
m_IsWindows
protected static Boolean m_IsWindows
whether the OS is Windows.
-
m_IsMac
protected static Boolean m_IsMac
whether the OS is Mac.
-
m_IsLinux
protected static Boolean m_IsLinux
whether the OS is Linux.
-
m_IsAndroid
protected static Boolean m_IsAndroid
whether the OS is Android.
-
m_IsArm64
protected static Boolean m_IsArm64
whether the architecture is arm64.
-
-
Method Detail
-
isWindows
public static boolean isWindows()
Checks whether the operating system is Windows.- Returns:
- true if the OS is Windows flavor
-
isMac
public static boolean isMac()
Checks whether the operating system is Mac.- Returns:
- true if the OS is Mac flavor
-
isArm64
public static boolean isArm64()
Checks whether the architecture is arm64.- Returns:
- true if arm64
-
isLinux
public static boolean isLinux()
Checks whether the operating system is Linux (but not Android).- Returns:
- true if the OS is Linux flavor (but not Android)
-
isAndroid
public static boolean isAndroid()
Checks whether the operating system is Android.- Returns:
- true if the OS is Android flavor
-
isOS
public static boolean isOS(OS.OperatingSystems os)
Tests whether the current OS is the same as the provided parameter.- Parameters:
os- the OS to test- Returns:
- true if it is the OS
-
getBitness
public static int getBitness()
Returns the "bitness", ie 32 or 64 bit of the underlying OS.- Returns:
- the number of bits
-
-