]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db/src/org/simantics/db/function/DbSupplier.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / function / DbSupplier.java
diff --git a/bundles/org.simantics.db/src/org/simantics/db/function/DbSupplier.java b/bundles/org.simantics.db/src/org/simantics/db/function/DbSupplier.java
new file mode 100644 (file)
index 0000000..1c1436c
--- /dev/null
@@ -0,0 +1,37 @@
+/*******************************************************************************\r
+ * Copyright (c) 2016 Association for Decentralized Information Management\r
+ * in Industry THTH ry.\r
+ * All rights reserved. This program and the accompanying materials\r
+ * are made available under the terms of the Eclipse Public License v1.0\r
+ * which accompanies this distribution, and is available at\r
+ * http://www.eclipse.org/legal/epl-v10.html\r
+ *\r
+ * Contributors:\r
+ *     Semantum Oy - initial API and implementation\r
+ *******************************************************************************/\r
+package org.simantics.db.function;\r
+\r
+import org.simantics.db.exception.DatabaseException;\r
+\r
+/**\r
+ * Represents a supplier of results for database operations.\r
+ *\r
+ * <p>There is no requirement that a new or distinct result be returned each\r
+ * time the supplier is invoked.\r
+ *\r
+ * @param <T> the type of results supplied by this supplier\r
+ *\r
+ * @author Tuukka Lehtonen\r
+ * @since 1.22.1 & 1.24.0\r
+ */\r
+@FunctionalInterface\r
+public interface DbSupplier<T> {\r
+\r
+    /**\r
+     * Performs this operation on the given argument.\r
+     *\r
+     * @param t the input argument\r
+     */\r
+    T get() throws DatabaseException;\r
+\r
+}\r