Repository: beam Updated Branches: refs/heads/master 7c5768b6e -> c7ff46d46
Add ThrowingBiConsumer to the set of functional interfaces Project: http://git-wip-us.apache.org/repos/asf/beam/repo Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/35dd2dd4 Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/35dd2dd4 Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/35dd2dd4 Branch: refs/heads/master Commit: 35dd2dd408685f94affeff503b9742e55495b2d8 Parents: 7c5768b Author: Luke Cwik <[email protected]> Authored: Fri Sep 8 09:41:27 2017 -0700 Committer: Luke Cwik <[email protected]> Committed: Fri Sep 8 11:21:43 2017 -0700 ---------------------------------------------------------------------- .../beam/fn/harness/fn/ThrowingBiConsumer.java | 33 ++++++++++++++++++++ 1 file changed, 33 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/beam/blob/35dd2dd4/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/fn/ThrowingBiConsumer.java ---------------------------------------------------------------------- diff --git a/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/fn/ThrowingBiConsumer.java b/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/fn/ThrowingBiConsumer.java new file mode 100644 index 0000000..fca8f3c --- /dev/null +++ b/sdks/java/harness/src/main/java/org/apache/beam/fn/harness/fn/ThrowingBiConsumer.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.beam.fn.harness.fn; + +import java.util.function.BiConsumer; + +/** + * A {@link BiConsumer} which can throw {@link Exception}s. + * + * <p>Used to expand the allowed set of method references to be used by Java 8 + * functional interfaces. + */ +@FunctionalInterface +public interface ThrowingBiConsumer<T1, T2> { + void accept(T1 t1, T2 t2) throws Exception; +} +
