diff options
Diffstat (limited to 'common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/Tools.java')
-rw-r--r-- | common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/Tools.java | 96 |
1 files changed, 0 insertions, 96 deletions
diff --git a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/Tools.java b/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/Tools.java deleted file mode 100644 index b4a4f03307..0000000000 --- a/common/plugins/org.eclipse.jpt.common.utility/src/org/eclipse/jpt/common/utility/internal/Tools.java +++ /dev/null @@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2009, 2010 Oracle. All rights reserved. - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License v1.0, which accompanies this distribution - * and is available at http://www.eclipse.org/legal/epl-v10.html. - * - * Contributors: - * Oracle - initial API and implementation - ******************************************************************************/ -package org.eclipse.jpt.common.utility.internal; - -/** - * Various utility methods. - */ -@SuppressWarnings("nls") -public final class Tools { - - // ********** object comparison ********** - - /** - * Return whether the specified values are equal, with the appropriate - * <code>null</code> checks. - */ - public static boolean valuesAreEqual(Object value1, Object value2) { - return (value1 == null) ? - (value2 == null) : - ((value2 != null) && value1.equals(value2)); - } - - /** - * Return whether the specified values are different, with the appropriate - * <code>null</code> checks. - */ - public static boolean valuesAreDifferent(Object value1, Object value2) { - return (value1 == null) ? - (value2 != null) : - ((value2 == null) || ! value1.equals(value2)); - } - - - // ********** System properties ********** - - /** - * Return whether the current JVM is Sun's (or Oracle's). - */ - public static boolean jvmIsSun() { - return jvmIs("Sun") || jvmIs("Oracle"); - } - - /** - * Return whether the current JVM is IBM's. - */ - public static boolean jvmIsIBM() { - return jvmIs("IBM"); - } - - private static boolean jvmIs(String jvmVendorName) { - return System.getProperty("java.vendor").startsWith(jvmVendorName); - } - - /** - * Return whether the current operating system is Microsoft Windows. - */ - public static boolean osIsWindows() { - return osIs("Windows"); - } - - /** - * Return whether the current operating system is Linux. - */ - public static boolean osIsLinux() { - return osIs("Linux"); - } - - /** - * Return whether the current operating system is Mac OS X. - */ - public static boolean osIsMac() { - return osIs("Mac"); - } - - private static boolean osIs(String osName) { - return System.getProperty("os.name").indexOf(osName) != -1; - } - - - // ********** constructor ********** - - /** - * Suppress default constructor, ensuring non-instantiability. - */ - private Tools() { - super(); - throw new UnsupportedOperationException(); - } -} |