Interface BasicObjectTheory<E>

All Known Subinterfaces:
AbelianRingTheory<E>, AdditiveAbelianGroupTheory<E>, AdditiveAbelianSemiGroupTheory<E>, AdditiveGroupTheory<E>, AdditiveMonoidTheory<E>, AdditiveSemiGroupTheory<E>, AlgebraicStructureTheory<E>, ComparableTheory<E>, CompleteFieldTheory<E>, CompleteScalarFieldTheory<E>, DivisibleGroupTheory<E>, DivisionRingTheory<E>, ElementTheory<E>, FieldTheory<E>, GroupTheory<E>, MagmaTheory<E>, MetricSpaceTheory<E,S>, MultiplicativeAbelianGroupTheory<E>, MultiplicativeAbelianSemiGroupTheory<E>, MultiplicativeGroupTheory<E>, MultiplicativeMonoidTheory<E>, MultiplicativeSemiGroupTheory<E>, OrderedTheory<E>, RingTheory<E>, RngTheory<E>, ScalarFieldTheory<E>, ScalarTheory<S>, SignedNumberTheory<E>, SizeableScalarTheory<S,SIZE>, SizeableTheory<E,SIZE>, StrictlyOrderedTheory<E>, UncertainDoubleTheory<E>, VectorSpaceTheory<V,S>, WithScalarTheory<E,S>

public interface BasicObjectTheory<E>
Basic tests on Object.equals(Object), Object.hashCode() and Object.toString(), which must probably be valid for any override of those.
Since:
0.10
Author:
Michiel Meeuwissen
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.jqwik.api.Arbitrary<@NonNull E>
    Provide non-null datapoints
    default net.jqwik.api.Arbitrary<@Nullable E>
     
    default net.jqwik.api.Arbitrary<@NonNull ? extends net.jqwik.api.Tuple.Tuple2<@NonNull E,@NonNull E>>
     
    default boolean
    equals(E e1, E e2)
    The implementation for equals datapoints (see equalDatapoints().
    default void
    For any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
    default void
    For any non-null reference value x, x.equals(x) should return true
    default void
    For any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
    default void
    equalsIsTransitive(net.jqwik.api.Tuple.Tuple2<E,E> p1, net.jqwik.api.Tuple.Tuple2<E,E> p2)
    For any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
    default void
    For any non-null reference value x, x.equals(null); should return false.
    default void
    For any non-null reference value x, x.equals(new Object); should return false.
    default void
    hashCodeIsConsistentWithEquals(net.jqwik.api.Tuple.Tuple2<E,E> pair)
    If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
    default void
    Whenever it is invoked on the same object more than once the hashCode() method must consistently return the same integer.
    default Logger
    log()
     
    default net.jqwik.api.Arbitrary<Random>
     
    default void
    toString(E object)
    toString of an object may be anything, but it may not throw exceptions.
  • Field Details

  • Method Details

    • equalsIsReflexive

      @Property default void equalsIsReflexive(@ForAll("datapoints") E x)
      For any non-null reference value x, x.equals(x) should return true
    • equalsIsSymmetric

      @Property default void equalsIsSymmetric(@ForAll("datapoints") E x, @ForAll("datapoints") E y)
      For any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
    • equalsIsTransitive

      @Property default void equalsIsTransitive(@ForAll("equalDatapoints") net.jqwik.api.Tuple.Tuple2<E,E> p1, @ForAll("equalDatapoints") net.jqwik.api.Tuple.Tuple2<E,E> p2)
      For any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
    • equalsIsConsistent

      @Property default void equalsIsConsistent(@ForAll("datapoints") E x, @ForAll("datapointsOrNull") E y)
      For any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
    • equalsReturnFalseOnNull

      @Property default void equalsReturnFalseOnNull(@ForAll("datapoints") E x)
      For any non-null reference value x, x.equals(null); should return false.
    • equalsReturnFalseOnOtherObject

      @Property default void equalsReturnFalseOnOtherObject(@ForAll("datapoints") E x)
      For any non-null reference value x, x.equals(new Object); should return false.
    • hashCodeIsSelfConsistent

      @Property default void hashCodeIsSelfConsistent(@ForAll("datapoints") E x)
      Whenever it is invoked on the same object more than once the hashCode() method must consistently return the same integer.
    • hashCodeIsConsistentWithEquals

      @Property default void hashCodeIsConsistentWithEquals(@ForAll("equalDatapoints") net.jqwik.api.Tuple.Tuple2<E,E> pair)
      If two objects are equal according to the equals(Object) method, then calling the hashCode method on each of the two objects must produce the same integer result.
    • toString

      @Property default void toString(@ForAll("datapoints") E object)
      toString of an object may be anything, but it may not throw exceptions.
    • datapoints

      @Provide net.jqwik.api.Arbitrary<@NonNull E> datapoints()
      Provide non-null datapoints
    • equals

      default boolean equals(E e1, E e2)
      The implementation for equals datapoints (see equalDatapoints(). Defaults to Objects.equals(Object, Object).
    • equalDatapoints

      @Provide default net.jqwik.api.Arbitrary<@NonNull ? extends net.jqwik.api.Tuple.Tuple2<@NonNull E,@NonNull E>> equalDatapoints()
    • datapointsOrNull

      @Provide default net.jqwik.api.Arbitrary<@Nullable E> datapointsOrNull()
    • randoms

      @Provide default net.jqwik.api.Arbitrary<Random> randoms()
    • log

      default Logger log()