< prev index next >

src/java.base/share/classes/java/util/function/Consumer.java

Print this page

        

*** 20,30 **** * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package java.util.function; import java.util.Objects; /** * Represents an operation that accepts a single input argument and returns no --- 20,30 ---- * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ ! package javany.util.function; import java.util.Objects; /** * Represents an operation that accepts a single input argument and returns no
*** 37,47 **** * @param <T> the type of the input to the operation * * @since 1.8 */ @FunctionalInterface ! public interface Consumer<T> { /** * Performs this operation on the given argument. * * @param t the input argument --- 37,47 ---- * @param <T> the type of the input to the operation * * @since 1.8 */ @FunctionalInterface ! public interface Consumer<any T> { /** * Performs this operation on the given argument. * * @param t the input argument
*** 58,67 **** * @param after the operation to perform after this operation * @return a composed {@code Consumer} that performs in sequence this * operation followed by the {@code after} operation * @throws NullPointerException if {@code after} is null */ ! default Consumer<T> andThen(Consumer<? super T> after) { Objects.requireNonNull(after); return (T t) -> { accept(t); after.accept(t); }; } } --- 58,67 ---- * @param after the operation to perform after this operation * @return a composed {@code Consumer} that performs in sequence this * operation followed by the {@code after} operation * @throws NullPointerException if {@code after} is null */ ! default Consumer<T> andThen(Consumer<T> after) { Objects.requireNonNull(after); return (T t) -> { accept(t); after.accept(t); }; } }
< prev index next >