Advertisement
Guest User

Ceylon to Java via Guava

a guest
Jul 10th, 2017
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ceylon 0.63 KB | None | 0 0
  1. import ceylon.collection {
  2.     ArrayList,
  3.     MutableList,
  4.     HashSet,
  5.     MutableSet
  6. }
  7.  
  8. import com.google.common.collect {
  9.     Lists,
  10.     Sets
  11. }
  12.  
  13. import java.util {
  14.     JList=List,
  15.     JSet=Set
  16. }
  17.  
  18. shared void run() {
  19.     MutableList<String> myCeylonList = ArrayList<String>();
  20.     myCeylonList.addAll { "hello", "this", "is", "my", "ceylon", "list" };
  21.  
  22.     JList<String> myJavaList = Lists.newArrayList(*myCeylonList);
  23.  
  24.     MutableSet<String> myCeylonSet = HashSet<String>();
  25.     myCeylonSet.addAll { "hello", "this", "is", "my", "ceylon", "set" };
  26.  
  27.     JSet<String> myJavaSet = Sets.newHashSet(*myCeylonSet);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement