Compares the pair based on the left element followed by the right element. The types must be Comparable. @param other the other pair, not null. @return negative if this is less, zero if equal, positive if greater.
(final Pair<L, R> other)
| 149 | * @return negative if this is less, zero if equal, positive if greater. |
| 150 | */ |
| 151 | @Override |
| 152 | public int compareTo(final Pair<L, R> other) { |
| 153 | // @formatter:off |
| 154 | return new CompareToBuilder() |
| 155 | .append(getLeft(), other.getLeft()) |
| 156 | .append(getRight(), other.getRight()) |
| 157 | .toComparison(); |
| 158 | // @formatter:on |
| 159 | } |
| 160 | |
| 161 | /** |
| 162 | * Compares this pair to another based on the two elements. |
no test coverage detected