Class Platform

java.lang.Object
com.stata.sfi.util.Platform

public class Platform extends Object
A set of utilities for getting platform information.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Determine if the platform is Linux.
    static boolean
    Determine if the platform is Mac OS.
    static boolean
    isMac(String version)
    Determine if the platform is Mac and the version is greater than or equal to the version specified.
    static boolean
    Determine if the platform is Solaris.
    static boolean
    Determine if the platform is Unix or Linux.
    static boolean
    Determine if the platform is Windows.
    static boolean
    isWindows(double version)
    Determine if the platform is Windows and the version is greater than or equal to the version specified.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isLinux

      public static boolean isLinux()
      Determine if the platform is Linux.
      Returns:
      True if the platform is Linux.
    • isMac

      public static boolean isMac()
      Determine if the platform is Mac OS.
      Returns:
      True if the platform is Mac OS.
    • isMac

      public static boolean isMac(String version)
      Determine if the platform is Mac and the version is greater than or equal to the version specified.
      Parameters:
      version - The Mac version to verify, such as 10.13.4
      Returns:
      True if the platform is Mac and the version is not less than specified.
    • isSolaris

      public static boolean isSolaris()
      Determine if the platform is Solaris.
      Returns:
      True if the platform is Solaris.
    • isUnix

      public static boolean isUnix()
      Determine if the platform is Unix or Linux.
      Returns:
      True if the platform is any variety of Unix, including Linux and Solaris.
    • isWindows

      public static boolean isWindows()
      Determine if the platform is Windows.
      Returns:
      True if the platform is Windows.
    • isWindows

      public static boolean isWindows(double version)
      Determine if the platform is Windows and the version is greater than or equal to the version specified.
      Parameters:
      version - The Windows version to verify. Version numbers correspond to internal Microsoft versions, such as 5.1, 6.0, 6.1, 6.2, 6.3, and 10.0.
      Returns:
      True if the platform is Windows and the version is not less than specified.