This is an automated email from the ASF dual-hosted git repository.
yhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git
The following commit(s) were added to refs/heads/master by this push:
new f45b5d88e1d Add SerializableSupplier to the core beam.sdk.util package
(#31766)
f45b5d88e1d is described below
commit f45b5d88e1d4578532bb0730f4af08e7fce24c1d
Author: Bartosz Zablocki <[email protected]>
AuthorDate: Thu Jul 4 00:44:13 2024 +0200
Add SerializableSupplier to the core beam.sdk.util package (#31766)
---
.../apache/beam/sdk/util/SerializableSupplier.java | 28 ++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git
a/sdks/java/core/src/main/java/org/apache/beam/sdk/util/SerializableSupplier.java
b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/SerializableSupplier.java
new file mode 100644
index 00000000000..c19c91d9161
--- /dev/null
+++
b/sdks/java/core/src/main/java/org/apache/beam/sdk/util/SerializableSupplier.java
@@ -0,0 +1,28 @@
+/*
+ * 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.sdk.util;
+
+import java.io.Serializable;
+import java.util.function.Supplier;
+
+/**
+ * A union of a {@link Supplier} and {@link Serializable}, enabling
configuration with {@link T}
+ * types that are not {@link Serializable}.
+ */
+@FunctionalInterface
+public interface SerializableSupplier<T> extends Supplier<T>, Serializable {}