]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db/src/org/simantics/db/function/DbBiConsumer.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / function / DbBiConsumer.java
index a1f378cf4b39faa1350ce34c536fb73ffbe89a73..f55d6f9298b415d9bb0c78b67c109bba7d98ee5a 100644 (file)
@@ -1,63 +1,63 @@
-/*******************************************************************************\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 java.util.Objects;\r
-\r
-import org.simantics.db.exception.DatabaseException;\r
-\r
-/**\r
- * Represents an operation that accepts two input arguments and returns no\r
- * result and can throw database exceptions. This is the two-arity\r
- * specialization of {@link DbConsumer}. Unlike most other functional interfaces,\r
- * {@code BiDbConsumer} is expected to operate via side-effects.\r
- *\r
- * @param <T>\r
- *            the type of the first argument to the operation\r
- * @param <U>\r
- *            the type of the second argument to the operation\r
- *\r
- * @see Consumer\r
- * @since 1.22.1 & 1.24.0\r
- */\r
-@FunctionalInterface\r
-public interface DbBiConsumer<T, U> {\r
-\r
-    /**\r
-     * Performs this operation on the given arguments.\r
-     *\r
-     * @param t the first input argument\r
-     * @param u the second input argument\r
-     */\r
-    void accept(T t, U u) throws DatabaseException;\r
-\r
-    /**\r
-     * Returns a composed {@code BiConsumer} that performs, in sequence, this\r
-     * operation followed by the {@code after} operation. If performing either\r
-     * operation throws an exception, it is relayed to the caller of the\r
-     * composed operation.  If performing this operation throws an exception,\r
-     * the {@code after} operation will not be performed.\r
-     *\r
-     * @param after the operation to perform after this operation\r
-     * @return a composed {@code BiConsumer} that performs in sequence this\r
-     * operation followed by the {@code after} operation\r
-     * @throws NullPointerException if {@code after} is null\r
-     */\r
-    default DbBiConsumer<T, U> andThen(DbBiConsumer<? super T, ? super U> after) {\r
-        Objects.requireNonNull(after);\r
-\r
-        return (l, r) -> {\r
-            accept(l, r);\r
-            after.accept(l, r);\r
-        };\r
-    }\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2016 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * 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:
+ *     Semantum Oy - initial API and implementation
+ *******************************************************************************/
+package org.simantics.db.function;
+
+import java.util.Objects;
+
+import org.simantics.db.exception.DatabaseException;
+
+/**
+ * Represents an operation that accepts two input arguments and returns no
+ * result and can throw database exceptions. This is the two-arity
+ * specialization of {@link DbConsumer}. Unlike most other functional interfaces,
+ * {@code BiDbConsumer} is expected to operate via side-effects.
+ *
+ * @param <T>
+ *            the type of the first argument to the operation
+ * @param <U>
+ *            the type of the second argument to the operation
+ *
+ * @see Consumer
+ * @since 1.22.1 & 1.24.0
+ */
+@FunctionalInterface
+public interface DbBiConsumer<T, U> {
+
+    /**
+     * Performs this operation on the given arguments.
+     *
+     * @param t the first input argument
+     * @param u the second input argument
+     */
+    void accept(T t, U u) throws DatabaseException;
+
+    /**
+     * Returns a composed {@code BiConsumer} that performs, in sequence, this
+     * operation followed by the {@code after} operation. If performing either
+     * operation throws an exception, it is relayed to the caller of the
+     * composed operation.  If performing this operation throws an exception,
+     * the {@code after} operation will not be performed.
+     *
+     * @param after the operation to perform after this operation
+     * @return a composed {@code BiConsumer} that performs in sequence this
+     * operation followed by the {@code after} operation
+     * @throws NullPointerException if {@code after} is null
+     */
+    default DbBiConsumer<T, U> andThen(DbBiConsumer<? super T, ? super U> after) {
+        Objects.requireNonNull(after);
+
+        return (l, r) -> {
+            accept(l, r);
+            after.accept(l, r);
+        };
+    }
+}