]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/errors/DoesNotExist.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / errors / DoesNotExist.java
diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/errors/DoesNotExist.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/errors/DoesNotExist.java
new file mode 100644 (file)
index 0000000..316233f
--- /dev/null
@@ -0,0 +1,32 @@
+package org.simantics.scl.compiler.errors;\r
+\r
+\r
+@SuppressWarnings("rawtypes")\r
+public enum DoesNotExist implements Failable {\r
+    INSTANCE;\r
+\r
+    @SuppressWarnings("unchecked")\r
+    public static <T> Failable<T> getInstance() {\r
+        return INSTANCE;\r
+    }\r
+\r
+    @Override\r
+    public Object getResult() {\r
+        throw new IllegalStateException("Module does not exist.");\r
+    }\r
+\r
+    @Override\r
+    public boolean didSucceed() {\r
+        return false;\r
+    }\r
+    \r
+    @Override\r
+    public String toString() {\r
+        return "DoesNotExist";\r
+    }\r
+\r
+    @Override\r
+    public String getDescription() {\r
+        return "Module does not exist.";\r
+    }\r
+}\r