-
-
Notifications
You must be signed in to change notification settings - Fork 272
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Streamlining code, fixed regression bug where the attachment names ar…
…e not ordered anymore, breaking unit tests
- Loading branch information
Showing
3 changed files
with
40 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
src/main/java/org/simplejavamail/internal/util/NaturalEntryKeyComparator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package org.simplejavamail.internal.util; | ||
|
||
import java.util.Comparator; | ||
import java.util.Map; | ||
|
||
public class NaturalEntryKeyComparator<T extends Comparable<T>> implements Comparator<Map.Entry<T, Object>> { | ||
|
||
public static final NaturalEntryKeyComparator INSTANCE = new NaturalEntryKeyComparator(); | ||
|
||
// TODO Lombok | ||
private NaturalEntryKeyComparator(){ | ||
} | ||
|
||
|
||
@Override | ||
public int compare(Map.Entry<T, Object> o1, Map.Entry<T, Object> o2) { | ||
return o1.getKey().compareTo(o2.getKey()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters