@Internal public class MutationDetectors extends java.lang.Object
MutationDetector.| Modifier and Type | Method and Description |
|---|---|
static <T> MutationDetector |
forValueWithCoder(T value,
Coder<T> coder)
Creates a new
MutationDetector for the provided value that uses the provided
Coder to perform deep copies and comparisons by serializing and deserializing values. |
static MutationDetector |
noopMutationDetector()
Creates a new
MutationDetector that always succeeds. |
public static <T> MutationDetector forValueWithCoder(T value, Coder<T> coder) throws CoderException
MutationDetector for the provided value that uses the provided
Coder to perform deep copies and comparisons by serializing and deserializing values.
It is permissible for value to be null. Since null is immutable, the
mutation check will always succeed.
CoderExceptionpublic static MutationDetector noopMutationDetector()
MutationDetector that always succeeds.
This is useful, for example, for providing a very efficient mutation detector for a value which is already immutable by design.