br.com.objectos.lang.OperatingSystem Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of objectos-lang Show documentation
Show all versions of objectos-lang Show documentation
A set of utilities for classes of the java.lang and the java.util packages.
The newest version!
/*
* Copyright (C) 2011-2021 Objectos Software LTDA.
*
* This file is part of the ObjectosComuns project.
*
* ObjectosComuns is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* ObjectosComuns is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with ObjectosComuns. If not, see .
*/
package br.com.objectos.lang;
public final class OperatingSystem {
private static final OperatingSystem INSTANCE = create();
private final Family family;
OperatingSystem(Family family) {
this.family = family;
}
static OperatingSystem getInstance() {
return INSTANCE;
}
private static OperatingSystem create() {
Family family;
String osName;
osName = System.getProperty("os.name");
if (osName.startsWith("Linux")) {
family = Family.LINUX;
}
else if (osName.startsWith("LINUX")) {
family = Family.LINUX;
}
else {
family = Family.UNKNOWN;
}
return new OperatingSystem(family);
}
public final Family getFamily() {
return family;
}
public enum Family {
LINUX,
UNKNOWN;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy