当前位置: 首页>>代码示例>>Java>>正文


Java C.newMap方法代码示例

本文整理汇总了Java中org.osgl.util.C.newMap方法的典型用法代码示例。如果您正苦于以下问题:Java C.newMap方法的具体用法?Java C.newMap怎么用?Java C.newMap使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.osgl.util.C的用法示例。


在下文中一共展示了C.newMap方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initService

import org.osgl.util.C; //导入方法依赖的package包/类
private void initService(String ssId, Map<String, String> conf) {
    Map<String, String> svcConf = C.newMap();
    String prefix = "ss." + (S.empty(ssId) ? "" : ssId + ".");
    for (String key : conf.keySet()) {
        if (key.startsWith(prefix)) {
            String o = conf.get(key);
            svcConf.put(key.substring(prefix.length()), o);
        }
    }
    String impl = svcConf.remove("impl");
    String svcId = S.empty(ssId) ? DEFAULT : ssId;
    if (null == impl) {
        throw new ConfigurationException("Cannot init storage service[%s]: implementation not specified", svcId);
    }
    StoragePlugin plugin = StoragePluginManager.instance().plugin(impl);
    if (null == plugin) {
        throw new ConfigurationException("Cannot init storage service[%s]: implementation not found", svcId);
    }
    svcConf.put(IStorageService.CONF_ID, "".equals(ssId) ? DEFAULT : ssId);
    IStorageService svc = plugin.initStorageService(ssId, app(), svcConf);
    serviceById.put(svcId, svc);
    logger.info("storage service[%s] initialized", svcId);
}
 
开发者ID:actframework,项目名称:act-storage,代码行数:24,代码来源:StorageServiceManager.java

示例2: prepareJsonData

import org.osgl.util.C; //导入方法依赖的package包/类
protected Map<String, Object> prepareJsonData(List<$.T2<String, Object>> params) {
    Map<String, Object> map = C.newMap();
    if (null != params) {
        for ($.T2<String, Object> pair : params) {
            String key = pair._1;
            Object val = pair._2;
            if (map.containsKey(key)) {
                List list;
                Object x = map.get(key);
                if (x instanceof List) {
                    list = $.cast(x);
                } else {
                    list = C.newList(x);
                    map.put(key, list);
                }
                list.add(val);
            } else {
                map.put(key, val);
            }
        }
    }
    return map;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:24,代码来源:EndpointTester.java

示例3: calibrate

import org.osgl.util.C; //导入方法依赖的package包/类
protected static Map<String, String> calibrate(Map<String, String> conf, String prefix) {
    Map<String, String> map = C.newMap();
    for (String key : conf.keySet()) {
        String val = conf.get(key);
        if (!key.startsWith("storage")) {
            key = prefix + key;
        }
        map.put(key, val);
    }
    return map;
}
 
开发者ID:actframework,项目名称:act-storage,代码行数:12,代码来源:StoragePlugin.java

示例4: validate

import org.osgl.util.C; //导入方法依赖的package包/类
private void validate(Genie genie) {
    Map<Object, Binder> map = C.newMap();
    for (Binder<?> binder : binders) {
        Object spec = binder.beanSpec(genie);
        if (map.containsKey(spec)) {
            throw E.invalidConfiguration("Duplicate bean spec found: ", spec);
        }
        map.put(spec, binder);
    }
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:11,代码来源:Module.java

示例5: randomScores

import org.osgl.util.C; //导入方法依赖的package包/类
private static Map<Subject, Integer> randomScores() {
    Map<Subject, Integer> scores = C.newMap();
    scores.put(Subject.ENGLISH, 60 + N.randInt(40));
    scores.put(Subject.MATH, 60 + N.randInt(40));
    scores.put(Subject.SCIENCE, 60 + N.randInt(40));
    return scores;
}
 
开发者ID:actframework,项目名称:act-demo-apps,代码行数:8,代码来源:Student.java

示例6: flip

import org.osgl.util.C; //导入方法依赖的package包/类
protected static <T> Map<T, String> flip(Map<String, T> map) {
    Map ret = C.newMap();
    for (Map.Entry<String, T> entry : map.entrySet()) {
        ret.put(entry.getValue(), entry.getKey());
    }
    return ret;
}
 
开发者ID:actframework,项目名称:actframework,代码行数:8,代码来源:SimpleTypeMapValBindingTestBase.java

示例7: create

import org.osgl.util.C; //导入方法依赖的package包/类
public static UploadFileStorageService create(App app) {
    File tmp = app.tmpDir();
    if (!tmp.exists() && !tmp.mkdirs()) {
        throw E.unexpected("Cannot create tmp dir");
    }
    Map<String, String> conf = C.newMap("storage.fs.home.dir", Files.file(app.tmpDir(), "uploads").getAbsolutePath(),
            "storage.keygen", KeyGenerator.Predefined.BY_DATE.name());
    conf.put(IStorageService.CONF_ID, "__upload");
    conf.put("storage.storeSuffix", "false");
    return new UploadFileStorageService(conf, app.config().uploadInMemoryCacheThreshold());
}
 
开发者ID:actframework,项目名称:actframework,代码行数:12,代码来源:UploadFileStorageService.java

示例8: get

import org.osgl.util.C; //导入方法依赖的package包/类
@Override
public C.Map<?, ?> get() {
    return C.newMap();
}
 
开发者ID:osglworks,项目名称:java-di,代码行数:5,代码来源:OsglMapProvider.java

示例9: setScores

import org.osgl.util.C; //导入方法依赖的package包/类
public void setScores(Map<Subject, Integer> scores) {
    this.scores = C.newMap(scores);
}
 
开发者ID:actframework,项目名称:act-demo-apps,代码行数:4,代码来源:Student.java

示例10: prepare

import org.osgl.util.C; //导入方法依赖的package包/类
@Before
public void prepare() {
    conf = C.newMap((Map)System.getProperties());
    conf.putAll(System.getenv());
}
 
开发者ID:actframework,项目名称:actframework,代码行数:6,代码来源:ConfigKeyHelperTest.java


注:本文中的org.osgl.util.C.newMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。