Revision 1c3cb06b
Added by Patrick Plitzner about 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/grantedAuthority/GrantedAuthorityDetailSection.java | ||
---|---|---|
10 | 10 |
package eu.etaxonomy.taxeditor.ui.section.grantedAuthority; |
11 | 11 |
|
12 | 12 |
import java.util.Collection; |
13 |
import java.util.Comparator; |
|
13 | 14 |
|
14 | 15 |
import org.springframework.security.core.GrantedAuthority; |
15 | 16 |
|
... | ... | |
53 | 54 |
return entity.getGrantedAuthorities(); |
54 | 55 |
} |
55 | 56 |
|
57 |
@Override |
|
58 |
public Comparator<GrantedAuthority> getComparator() { |
|
59 |
return new Comparator<GrantedAuthority>() { |
|
60 |
|
|
61 |
@Override |
|
62 |
public int compare(GrantedAuthority o1, GrantedAuthority o2) { |
|
63 |
if(o1==null){ |
|
64 |
return -1; |
|
65 |
} |
|
66 |
if(o2==null){ |
|
67 |
return 1; |
|
68 |
} |
|
69 |
return o1.getAuthority().compareTo(o2.getAuthority()); |
|
70 |
} |
|
71 |
}; |
|
72 |
} |
|
73 |
|
|
56 | 74 |
/* |
57 | 75 |
* (non-Javadoc) |
58 | 76 |
* |
Also available in: Unified diff
fix #6330 Add default sorting for all entity collections