src/share/classes/java/util/function/IntSupplier.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,40 **** package java.util.function; /** * A supplier of {@code int} values. * ! * <p/>This is the primitive type specialization of {@link Supplier} for ! * {@code int} and also may be used as a {@code Supplier<Integer>}. * * @since 1.8 */ ! public interface IntSupplier { /** * Returns an {@code int} value. * * @return an {@code int} value --- 25,50 ---- package java.util.function; /** * A supplier of {@code int} values. * ! * This is the primitive type specialization of {@link Supplier} for {@code int} ! * and also may be used as a {@code Supplier<Integer>}. * * @since 1.8 */ ! public interface IntSupplier extends Supplier<Integer> { ! ! /** ! * {@inheritDoc} ! * ! * @return {@inheritDoc}, always non-null ! */ ! @Override ! public default Integer get() { ! return getAsInt(); ! } /** * Returns an {@code int} value. * * @return an {@code int} value