Interface EqualsVerifierApi<T>

    • Method Detail

      • suppress

        EqualsVerifierApi<T> suppress​(Warning... warnings)
        Suppresses warnings given by EqualsVerifier. See Warning to see what warnings can be suppressed.
        Parameters:
        warnings - A list of warnings to suppress in EqualsVerifier.
        Returns:
        this, for easy method chaining.
      • withPrefabValues

        <S> EqualsVerifierApi<T> withPrefabValues​(Class<S> otherType,
                                                  S red,
                                                  S blue)
        Adds prefabricated values for instance fields of classes that EqualsVerifier cannot instantiate by itself.
        Type Parameters:
        S - The class of the prefabricated values.
        Parameters:
        otherType - The class of the prefabricated values.
        red - An instance of S.
        blue - Another instance of S, not equal to red.
        Returns:
        this, for easy method chaining.
        Throws:
        NullPointerException - If either otherType, red, or blue is null.
        IllegalArgumentException - If red equals blue.
      • withGenericPrefabValues

        <S> EqualsVerifierApi<T> withGenericPrefabValues​(Class<S> otherType,
                                                         Func.Func1<?,​S> factory)
        Adds a factory to generate prefabricated values for instance fields of classes with 1 generic type parameter that EqualsVerifier cannot instantiate by itself.
        Type Parameters:
        S - The class of the prefabricated values.
        Parameters:
        otherType - The class of the prefabricated values.
        factory - A factory to generate an instance of S, given a value of its generic type parameter.
        Returns:
        this, for easy method chaining.
        Throws:
        NullPointerException - if either otherType or factory is null.
      • withGenericPrefabValues

        <S> EqualsVerifierApi<T> withGenericPrefabValues​(Class<S> otherType,
                                                         Func.Func2<?,​?,​S> factory)
        Adds a factory to generate prefabricated values for instance fields of classes with 2 generic type parameters that EqualsVerifier cannot instantiate by itself.
        Type Parameters:
        S - The class of the prefabricated values.
        Parameters:
        otherType - The class of the prefabricated values.
        factory - A factory to generate an instance of S, given a value of each of its generic type parameters.
        Returns:
        this, for easy method chaining.
        Throws:
        NullPointerException - if either otherType or factory is null.
      • usingGetClass

        EqualsVerifierApi<T> usingGetClass()
        Signals that getClass is used in the implementation of the equals method, instead of an instanceof check.
        Returns:
        this, for easy method chaining.
        See Also:
        Warning.STRICT_INHERITANCE