com.google.common.collect.testing
Class Helpers.NullsBefore
java.lang.Object
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
Helpers.NullsBefore
protected Helpers.NullsBefore(String justAfterNull)
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.