插件开发工具库,推荐依赖该工具库。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

46 lines
1000 B

package com.fanruan.api.macro;
import com.fr.stable.os.AbstractOperatingSystem;
/**
* 操作系统判断类,判断操作系统种类
* @author Kalven
* @version 10.0
* Created by Kalven on 2019/8/31
*/
public class OperatingSystem {
/**
* 得到当前操作系统信息
*/
private static final AbstractOperatingSystem myOS = com.fr.stable.os.OperatingSystem.getOperatingSystem();
private OperatingSystem() {
}
/**
* 判断系统是否是Windows
* @return 判断结果
*/
public static boolean isWindows() {
return myOS.getType() == com.fr.stable.os.OperatingSystem.WINDOWS;
}
/**
* 判断系统是否是Unix
* @return 判断结果
*/
public static boolean isUnix() {
return myOS.isUnix();
}
/**
* 判断系统是否是MacOS
* @return 判断结果
*/
public static boolean isMacOS() {
return myOS.getType() == com.fr.stable.os.OperatingSystem.MACOS;
}
}