daily pastebin goal
19%
SHARE
TWEET

Ceylon to Java via Guava

a guest Jul 10th, 2017 159 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top