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

Print this page
rev 6189 : 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

@@ -25,16 +25,26 @@
 package java.util.function;
 
 /**
  * A supplier of {@code long} values.
  *
- * <p/>This is the primitive type specialization of {@link Supplier} for
+ * <p>This is the primitive type specialization of {@link Supplier} for
  * {@code long} and also may be used as a {@code Supplier<Long>}.
  *
  * @since 1.8
  */
-public interface LongSupplier {
+public interface LongSupplier extends Supplier<Long> {
+
+    /**
+     * {@inheritDoc}
+     *
+     * @return {@inheritDoc}, always non-null
+     */
+    @Override
+    public default Long get() {
+        return getAsLong();
+    }
 
     /**
      * Returns a {@code long} value.
      *
      * @return a {@code long} value.