src/share/classes/java/util/function/LongBinaryOperator.java

Print this page
rev 6137 : 8004015: Add Extends and deaults for basic functional interface types
Summary: Adds the appropriate extends and default methods for  core functional interfaces used by the JSR335 libraries.
Reviewed-by: duke

@@ -27,11 +27,14 @@
 /**
  * An operation on two {@code long} operands yielding a {@code long} result.
  *
  * @since 1.8
  */
-public interface LongBinaryOperator {
+public interface LongBinaryOperator extends BinaryOperator<Long> {
+
+    @Override
+    public default Long operate(Long left, Long right) { return operateAsLong((long) left, (long) right); }
 
     /**
      * Returns the {@code long} result of the operation upon the {@code long}
      * operands. The parameters are named {@code left} and {@code right} for
      * operations where the order of parameters matters.