Example usage for com.google.common.collect Maps newHashMap

List of usage examples for com.google.common.collect Maps newHashMap

Introduction

In this page you can find the example usage for com.google.common.collect Maps newHashMap.

Prototype

public static <K, V> HashMap<K, V> newHashMap() 

Source Link

Document

Creates a mutable, empty HashMap instance.

Usage

From source file:org.apache.kylin.dict.Number2BytesConverter.java

static NumberBytesCodec getCodec(int maxDigitsBeforeDecimalPoint) {
    Map<Integer, NumberBytesCodec> codecMap = LOCAL.get();
    if (codecMap == null) {
        codecMap = Maps.newHashMap();
        LOCAL.set(codecMap);// w  w w  .  j  a v  a2  s.co  m
    }
    NumberBytesCodec codec = codecMap.get(maxDigitsBeforeDecimalPoint);
    if (codec == null) {
        codec = new NumberBytesCodec(maxDigitsBeforeDecimalPoint);
        codecMap.put(maxDigitsBeforeDecimalPoint, codec);
    }
    return codec;
}

From source file:domainapp.application.integtests.DomainAppIntegTestAbstract.java

@BeforeClass
public static void initSystem() {
    org.apache.log4j.PropertyConfigurator.configure("logging-integtest.properties");
    IsisSystemForTest isft = IsisSystemForTest.getElseNull();
    if (isft == null) {
        isft = new IsisSystemForTest.Builder().withLoggingAt(org.apache.log4j.Level.INFO)
                .with(new RitaAppManifest() {
                    @Override// ww  w . java 2s . c  om
                    public Map<String, String> getConfigurationProperties() {
                        final Map<String, String> map = Maps.newHashMap();
                        Util.withJavaxJdoRunInMemoryProperties(map);
                        Util.withDataNucleusProperties(map);
                        Util.withIsisIntegTestProperties(map);
                        return map;
                    }
                }).build();
        isft.setUpSystem();
        IsisSystemForTest.set(isft);
    }

    // instantiating will install onto ThreadLocal
    new ScenarioExecutionForIntegration();
}

From source file:org.apache.nutch.api.impl.db.DbPageConverter.java

public static Map<String, Object> convertPage(WebPage page, Set<String> fields) {
    Map<String, Object> result = Maps.newHashMap();
    for (Field field : filterFields(page, fields)) {
        Object value = convertField(page, field);
        if (value != null) {
            result.put(field.name(), value);
        }/*w  ww.ja va 2s.  co  m*/
    }
    return result;
}

From source file:org.geogit.rest.repository.RepositoryResource.java

@Override
public Map<String, Object> getMap() throws Exception {

    Map<String, Object> map = Maps.newHashMap();
    PageInfo pageInfo = getPageInfo();/* w  ww  .java 2 s  .co  m*/
    map.put("page", pageInfo);

    map.put("Manifest", "manifest");
    return map;
}

From source file:com.cloudera.exhibit.sql.ModifiableSchema.java

public ModifiableSchema() {
    this.tableMap = Maps.newHashMap();
}

From source file:tv.icntv.log.stb.commons.SplitterIcntv.java

public static Map<String, String> toMap(Iterable<String> iterable, String split) {
    Iterator<String> it = iterable.iterator();
    Map<String, String> maps = Maps.newHashMap();
    while (it.hasNext()) {
        String value = it.next();
        List<String> result = Lists.newArrayList(Splitter.on(split).trimResults().limit(2).split(value));
        if (result.size() != 2) {
            logger.error("message = {}", value);
            continue;
        }//ww  w.j  av a  2  s .c o m
        maps.put(result.get(0), result.get(1));
    }
    return maps;
}

From source file:com.framework.demo.service.push.PushApiImpl.java

public void pushNewNotification(final Long userId, List<Map<String, Object>> notifiations) {
    Map<String, Object> data = Maps.newHashMap();
    data.put("notifications", notifiations);
    pushService.push(userId, data);//from   w  w w.j  a  va2 s. c  o  m
}

From source file:us.physion.ovation.ui.editor.ContentTypes.java

private static Map<String, String> customTypes() {
    final Map<String, String> customContentTypes = Maps.newHashMap();
    customContentTypes.put("doc", "application/msword");
    customContentTypes.put("docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document");
    customContentTypes.put("xls", "application/vnd.ms-excel");
    customContentTypes.put("xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
    customContentTypes.put("ppt", "application/vnd.ms-powerpoint");
    customContentTypes.put("pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation");
    customContentTypes.put("csv", "text/csv");
    customContentTypes.put("tif", "image/tiff");
    customContentTypes.put("tiff", "image/tiff");
    customContentTypes.put("lsm", "image/tiff");
    customContentTypes.put("pdf", "application/pdf");
    return customContentTypes;
}

From source file:com.oms.modules.sys.utils.DictUtils.java

public static List<Dict> getDictList(String type) {
    @SuppressWarnings("unchecked")
    Map<String, List<Dict>> dictMap = (Map<String, List<Dict>>) CacheUtils.get(CACHE_DICT_MAP);
    if (dictMap == null) {
        dictMap = Maps.newHashMap();
        for (Dict dict : dictDao.findAllList()) {
            List<Dict> dictList = dictMap.get(dict.getType());
            if (dictList != null) {
                dictList.add(dict);/*from  www  .  j a va  2 s . c  om*/
            } else {
                dictMap.put(dict.getType(), Lists.newArrayList(dict));
            }
        }
        CacheUtils.put(CACHE_DICT_MAP, dictMap);
    }
    List<Dict> dictList = dictMap.get(type);
    if (dictList == null) {
        dictList = Lists.newArrayList();
    }
    return dictList;
}

From source file:org.ubiquity.util.visitors.Annotation.java

public Annotation() {
    this.properties = Maps.newHashMap();
}