Event Dispatcher  v0.1.6-beta.1
Project that offers a small library that allows to subscribe and fire events.
ComparableContract< T extends Comparable< T >

Detailed Description

This interface defines tests to verify that the objects of each class that implements the Comparable interface, impose their total ordering with the expected behavior.

This ordering is referred to as the classes natural ordering, and the classes

compareTo

method is referred to as its natural comparison method.

This class extends from Testable, and in order to function correctly all the required methods must be implemented.

Parameters
<T>the type of objects that this object may be compared to
See also
Testable

Definition at line 26 of file ComparableContract.java.

+ Inheritance diagram for ComparableContract< T extends Comparable< T >:

Public Member Functions

createSmallerValue ()
 
default void comparedToItself ()
 
default void compareToSmallerValue ()
 
default void compareToLargerValue ()
 
- Public Member Functions inherited from Testable< T >
createValue ()
 

Member Function Documentation

◆ createSmallerValue()

T createSmallerValue ( )

Creates and returns a smaller value to use in the comparable tests.


This method, for its correct execution, should return a value smaller than the returned by Testable#createValue.

Returns
the created value

◆ comparedToItself()

default void comparedToItself ( )

Compares the created value to itself to test that returns a zero value.

Definition at line 42 of file ComparableContract.java.

◆ compareToSmallerValue()

default void compareToSmallerValue ( )

Compares the created value to a smaller value to test that returns a positive value.

Definition at line 53 of file ComparableContract.java.

◆ compareToLargerValue()

default void compareToLargerValue ( )

Compares the created value to a larger value to test that returns a negative value.

Definition at line 65 of file ComparableContract.java.