If you simply want to experiment with Manifold, this project will help get you started.
git clone https://github.com/manifold-systems/manifold-sample-project.git
Settings | Plugins | Marketplace
File | Project Structure | SDKs | + | path-to-your-Jdk11
File | Project Structure | Project
select 11
for both Project JDK
and Project language level
abc/RunMe.java
filepackage manifoldsampleproject.extensions.java.util.Map;
import manifold.ext.rt.api.Extension;
import manifold.ext.rt.api.This;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
@Extension
public class MyMapExtension {
public static <K, V> boolean containsKeys(@This Map<K, V> thiz, Collection<K> keys) {
return thiz.keySet().containsAll(keys);
}
public static class Entry {
public static <K, V> String hiFromEntry(@This Map.Entry<K, V> thiz) {
return "hiFromEntry";
}
}
/**
* 我的put
* @param thiz
* @param k
* @param v
* @param <K>
* @param <V>
* @return
*/
public static <K, V> Map<K, V> myPut(@This Map<K,V> thiz,K k,V v){
thiz.put(k,v);
return thiz;
}
}
package manifoldsampleproject.extensions.java.lang.String;
import manifold.ext.rt.api.Extension;
import manifold.ext.rt.api.This;
import java.lang.String;
@Extension
public class MyStringExt {
public static void echo( @This String thiz) {
System.out.println(thiz);
}
public static void print( @This String thiz) {
System.out.println(thiz+"qqq");
}
}