Package org.apache.beam.sdk.util
Class MutationDetectors
- java.lang.Object
-
- org.apache.beam.sdk.util.MutationDetectors
-
@Internal public class MutationDetectors extends java.lang.Object
Static methods for creating and working withMutationDetector
.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> MutationDetector
forValueWithCoder(T value, Coder<T> coder)
Creates a newMutationDetector
for the providedvalue
that uses the providedCoder
to perform deep copies and comparisons by serializing and deserializing values.static MutationDetector
noopMutationDetector()
Creates a newMutationDetector
that always succeeds.
-
-
-
Method Detail
-
forValueWithCoder
public static <T> MutationDetector forValueWithCoder(T value, Coder<T> coder) throws CoderException
Creates a newMutationDetector
for the providedvalue
that uses the providedCoder
to perform deep copies and comparisons by serializing and deserializing values.It is permissible for
value
to benull
. Sincenull
is immutable, the mutation check will always succeed.- Throws:
CoderException
-
noopMutationDetector
public static MutationDetector noopMutationDetector()
Creates a newMutationDetector
that always succeeds.This is useful, for example, for providing a very efficient mutation detector for a value which is already immutable by design.
-
-