net.sf.sasl.common.helper
Class CompareToHelper

java.lang.Object
  extended by net.sf.sasl.common.helper.CompareToHelper

public class CompareToHelper
extends Object

Class offers helper operations for object comparison.

Since:
0.0.2 (sasl-common-library)
Author:
Philipp Förmer

Constructor Summary
CompareToHelper()
           
 
Method Summary
<T extends Comparable<T>>
int
compareTo(T one, T two)
          Compares one with two, without causing null pointer exceptions, if one or two is null.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompareToHelper

public CompareToHelper()
Method Detail

compareTo

public <T extends Comparable<T>> int compareTo(T one,
                                               T two)
Compares one with two, without causing null pointer exceptions, if one or two is null. The return value is:

Type Parameters:
T -
Parameters:
one - null or non null.
two - null or non null.
Returns:
-1, 0 or 1.
Since:
0.0.2 (sasl-common-library)


Copyright © 2010. All Rights Reserved.