Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/pasteInNewTable/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/BooleanHelper.java')
-rw-r--r--sandbox/pasteInNewTable/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/BooleanHelper.java38
1 files changed, 38 insertions, 0 deletions
diff --git a/sandbox/pasteInNewTable/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/BooleanHelper.java b/sandbox/pasteInNewTable/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/BooleanHelper.java
new file mode 100644
index 00000000000..ecfd0c97955
--- /dev/null
+++ b/sandbox/pasteInNewTable/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/BooleanHelper.java
@@ -0,0 +1,38 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ *
+ * 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:
+ * Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.tools.util;
+
+/**
+ *
+ * This class provides an useful methods for boolean
+ *
+ */
+public class BooleanHelper {
+
+ private BooleanHelper() {
+ //to prevent instanciation
+ }
+
+ /**
+ *
+ * @param str
+ * a string
+ * @return
+ * <code>true</code> if the string represents a boolean value
+ */
+ public static final boolean isBoolean(final String str) {
+ return "true".equalsIgnoreCase(str) || "false".equalsIgnoreCase(str); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+}

Back to the top