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 class
OS.OperatingSystems
Enumeration of OS.
-
Field Summary
Fields Modifier and Type Field Description protected static Boolean
m_IsAndroid
whether the OS is Android.protected static Boolean
m_IsArm64
whether the architecture is arm64.protected static Boolean
m_IsLinux
whether the OS is Linux.protected static Boolean
m_IsMac
whether the OS is Mac.protected static Boolean
m_IsWindows
whether the OS is Windows.
-
Constructor Summary
Constructors Constructor Description OS()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
getBitness()
Returns the "bitness", ie 32 or 64 bit of the underlying OS.static boolean
isAndroid()
Checks whether the operating system is Android.static boolean
isArm64()
Checks whether the architecture is arm64.static boolean
isLinux()
Checks whether the operating system is Linux (but not Android).static boolean
isMac()
Checks whether the operating system is Mac.static boolean
isOS(OS.OperatingSystems os)
Tests whether the current OS is the same as the provided parameter.static boolean
isWindows()
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
-
-