Created
May 5, 2014 09:08
-
-
Save akisute/a8c07c8c0f1505de9991 to your computer and use it in GitHub Desktop.
Google Guava ROCKS
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
public int getCryptoTypeDumb() { | |
// With Plain Java | |
List<Network> networkList = new ArrayList(mNetworkSet); | |
Collections.sort(networkList, NetworkComparators.CRYPTOTYPE_WEAKEST_TO_STRONGEST); | |
return networkList.get(0).getCryptoType(); | |
} | |
public int getCryptoType() { | |
// With Google Guava | |
return Ordering.from(NetworkComparators.CRYPTOTYPE_WEAKEST_TO_STRONGEST).min(mNetworkSet).getCryptoType(); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment