com.google.common.collect.testing
Class Helpers.NullsBefore

java.lang.Object
  extended by com.google.common.collect.testing.Helpers.NullsBefore
All Implemented Interfaces:
Serializable, Comparator<String>
Direct Known Subclasses:
Helpers.NullsBeforeB, Helpers.NullsBeforeTwo
Enclosing class:
Helpers

public abstract static class Helpers.NullsBefore
extends Object
implements Comparator<String>, Serializable

Compares strings in natural order except that null comes immediately before a given value. This works better than Ordering.natural().nullsFirst() because, if null comes before all other values, it lies outside the submap/submultiset ranges we test, and the variety of tests that exercise null handling fail on those subcollections.

See Also:
Serialized Form

Constructor Summary
protected Helpers.NullsBefore(String justAfterNull)
           
 
Method Summary
 int compare(String lhs, String rhs)
           
 boolean equals(Object obj)
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Helpers.NullsBefore

protected Helpers.NullsBefore(String justAfterNull)
Method Detail

compare

public int compare(String lhs,
                   String rhs)
Specified by:
compare in interface Comparator<String>

equals

public boolean equals(Object obj)
Specified by:
equals in interface Comparator<String>
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2010-2012. All Rights Reserved.