Created
August 8, 2012 16:27
-
-
Save kaspernielsen/3296400 to your computer and use it in GitHub Desktop.
Cake getting started
This file contains hidden or 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
import java.util.Arrays; | |
import org.cakeframework.big.map.BigMap; | |
import org.cakeframework.big.map.BigMapConfiguration; | |
/** | |
* | |
* @author Kasper Nielsen | |
*/ | |
public class Tester { | |
public static void main(String[] args) { | |
BigMapConfiguration<String, Integer> c = BigMapConfiguration.newConfiguration(String.class, Integer.TYPE); | |
// c.withCodegen().addCodeWriter(System.out); //uncomment to see generated code | |
BigMap<String, Integer> m = c.create(); | |
m.put("A", 1).put("B", 2).put("C", 3); | |
System.out.println(m.getAll(Arrays.asList("A", "C")).toMap()); | |
System.out.println(m.entries().orderByKey().take(2).keys().toList()); | |
System.out.println(Arrays.toString(m.values().orderDescending().to(Integer[].class))); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment