ch.sahits.test
Class ComparetorResult

java.lang.Object
  extended by ch.sahits.test.ComparetorResult

public class ComparetorResult
extends java.lang.Object

This class represents the result of a complex comparison. Besides the simple true/false value there is also a textual message explaning how the comarison is unequal

Since:
2.1.0
Author:
Andi Hotz, Sahits GmbH

Field Summary
static ComparetorResult TRUE
          Instance representing a successfull comparison
 
Constructor Summary
ComparetorResult(boolean resultValue, java.lang.String msg)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Instance of this class is equal if the test and the message are equal
 java.lang.String getMessage()
          Retrieve the comparison message
 int hashCode()
           
 boolean isTrue()
          Check if the comparison was successful
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TRUE

public static ComparetorResult TRUE
Instance representing a successfull comparison

Constructor Detail

ComparetorResult

public ComparetorResult(boolean resultValue,
                        java.lang.String msg)
Method Detail

isTrue

public boolean isTrue()
Check if the comparison was successful

Returns:
true if the comparison was successful

getMessage

public java.lang.String getMessage()
Retrieve the comparison message

Returns:
message of the error or null if the comparison was successful

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Instance of this class is equal if the test and the message are equal

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object