commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey De Smet <ge0ffrey.s...@gmail.com>
Subject [lang] null-safe compareTo method
Date Mon, 20 Feb 2006 11:05:22 GMT
Is there a null-safe compare method?
I need to compare 2 strings:
- both null => equal
- one null => that one is smaller
- neither null => a.compareTo(b)

Else I 'd propose something like:
ObjectUtils.compare(Comparable a, Comparable b)

-- 
With kind regards,
Geoffrey De Smet


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message