org.oddjob.beancmpr
Interface Comparison<T>

All Known Subinterfaces:
MultiValueComparison<T>, NumericComparison
All Known Implementing Classes:
BeanComparison, EqualityComparison, IterableComparison, MatchableComparision

public interface Comparison<T>

The result of a Comparer is a comparison between two things.

Author:
Rob

Method Summary
 int getResult()
          The result of the comparison.
 String getSummaryText()
          Provide a brief summary of the comparison.
 T getX()
          Get the x of the comparison.
 T getY()
          Get the y of the comparison.
 

Method Detail

getX

T getX()
Get the x of the comparison.

Returns:
The x. Will not be null.

getY

T getY()
Get the y of the comparison.

Returns:
The y. Will not be null.

getResult

int getResult()
The result of the comparison. 0 they are equal. -1 when x < y and 1 when x > y

Returns:
true/false.

getSummaryText

String getSummaryText()
Provide a brief summary of the comparison.

If the comparison is equal then this should be the text representation of either of the original values. If the comparison is not equal then this should be a short description of the difference, e.g. 'Fred <> Jane'.

As a rule of thumb summary should be suitable for displaying in the column of a report or the cell of a spreadsheet.

Returns:
A short text description of the comparison.


Copyright © 2013. All Rights Reserved.