Java Code Examples for com.google.common.collect.Comparators

The following are top voted examples for showing how to use com.google.common.collect.Comparators. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: atomix   File: DocumentPath.java   View source code 4 votes vote down vote up
@Override
public int compareTo(DocumentPath that) {
  return Comparators.lexicographical(Comparator.<String>naturalOrder())
      .compare(this.pathElements, that.pathElements);
}
 
Example 2
Project: onos   File: DocumentPath.java   View source code 4 votes vote down vote up
@Override
public int compareTo(DocumentPath that) {
    return Comparators.lexicographical(Comparator.<String>naturalOrder())
            .compare(this.pathElements, that.pathElements);
}