]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.utils.datastructures/src/org/simantics/utils/datastructures/BinaryFunction.java
Deprecate BinaryFunction in favor of BiFunction functional interface
[simantics/platform.git] / bundles / org.simantics.utils.datastructures / src / org / simantics / utils / datastructures / BinaryFunction.java
index 30c15ca2ecb0fb569a717951560eba1742117cd5..98412e50e4e55a99ce66348561100d3ff4c0401d 100644 (file)
@@ -1,18 +1,29 @@
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 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
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.utils.datastructures;\r
-\r
-public interface BinaryFunction<R, A1, A2> {\r
-\r
-    R call(A1 arg1, A2 arg2);\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 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:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.utils.datastructures;
+
+import java.util.function.BiFunction;
+
+/**
+ * @deprecated use {@link BiFunction} instead
+ */
+@Deprecated
+@FunctionalInterface
+public interface BinaryFunction<R, A1, A2> extends BiFunction<A1, A2, R>{
+
+    R call(A1 arg1, A2 arg2);
+
+    @Override
+    default R apply(A1 arg, A2 arg2) {
+        return call(arg, arg2);
+    }
+}