List of usage examples for com.google.common.collect ImmutableSortedMap reverseOrder
public static <K extends Comparable<?>, V> Builder<K, V> reverseOrder()
From source file:com.xebialabs.overthere.cifs.PathMapper.java
@VisibleForTesting PathMapper(final Map<String, String> mappings) { // longest first, so reverse lexicographical order ImmutableSortedMap.Builder<String, String> sharesForPath = ImmutableSortedMap.reverseOrder(); ImmutableMap.Builder<String, String> pathsForShare = ImmutableMap.builder(); for (Entry<String, String> mapping : mappings.entrySet()) { String pathPrefixToMatch = mapping.getKey(); String shareForPathPrefix = mapping.getValue(); sharesForPath.put(pathPrefixToMatch.toLowerCase(), shareForPathPrefix); pathsForShare.put(shareForPathPrefix.toLowerCase(), pathPrefixToMatch); }//from w w w .j a v a2s .c o m this.sharesForPaths = sharesForPath.build(); this.pathsForShares = pathsForShare.build(); }