Class MutationDetectors


  • @Internal
    public class MutationDetectors
    extends java.lang.Object
    Static methods for creating and working with MutationDetector.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • forValueWithCoder

        public static <T> MutationDetector forValueWithCoder​(T value,
                                                             Coder<T> coder)
                                                      throws CoderException
        Creates a new 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.

        Throws:
        CoderException
      • noopMutationDetector

        public static MutationDetector noopMutationDetector()
        Creates a new 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.