analysis.lami: Implementation of LAMI plugins
[deliverable/tracecompass.git] / analysis / org.eclipse.tracecompass.analysis.lami.core / src / org / eclipse / tracecompass / internal / provisional / analysis / lami / core / types / LamiBoolean.java
diff --git a/analysis/org.eclipse.tracecompass.analysis.lami.core/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/core/types/LamiBoolean.java b/analysis/org.eclipse.tracecompass.analysis.lami.core/src/org/eclipse/tracecompass/internal/provisional/analysis/lami/core/types/LamiBoolean.java
new file mode 100644 (file)
index 0000000..a23b8ba
--- /dev/null
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2015, 2016 EfficiOS Inc., Alexandre Montplaisir
+ *
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.tracecompass.internal.provisional.analysis.lami.core.types;
+
+import static org.eclipse.tracecompass.common.core.NonNullUtils.nullToEmptyString;
+
+import org.eclipse.jdt.annotation.Nullable;
+
+class LamiBoolean extends LamiData {
+
+    private static final LamiBoolean TRUE = new LamiBoolean(true);
+    private static final LamiBoolean FALSE = new LamiBoolean(false);
+
+    public static LamiBoolean instance(boolean value) {
+        return (value ? TRUE : FALSE);
+    }
+
+    private final boolean fValue;
+
+    private LamiBoolean(boolean value) {
+        fValue = value;
+    }
+
+    public boolean getValue() {
+        return fValue;
+    }
+
+    @Override
+    public @Nullable String toString() {
+        return (fValue ?
+                nullToEmptyString(Messages.LamiBoolean_Yes) :
+                nullToEmptyString(Messages.LamiBoolean_No));
+    }
+}
This page took 0.025167 seconds and 5 git commands to generate.