Example usage for java.util Collections emptyMap

List of usage examples for java.util Collections emptyMap

Introduction

In this page you can find the example usage for java.util Collections emptyMap.

Prototype

@SuppressWarnings("unchecked")
public static final <K, V> Map<K, V> emptyMap() 

Source Link

Document

Returns an empty map (immutable).

Usage

From source file:com.arrow.acn.client.api.CoreEventApi.java

public StatusModel putSucceeded(String hid) {
    return putSucceeded(hid, Collections.emptyMap());
}

From source file:org.pdfsam.ui.JsonWorkspaceService.java

@SuppressWarnings("unchecked")
public Map<String, Map<String, String>> loadWorkspace(File workspace) {
    requireNotNull(workspace, "Workspace file cannot be null");
    Map<String, Map<String, String>> data = Collections.emptyMap();
    try (FileInputStream stream = new FileInputStream(workspace)) {
        data = (Map) JSON.std.mapFrom(stream);
    } catch (Exception e) {
        // make it unchecked
        throw new RuntimeException(e);
    }//from w ww.  jav  a 2  s.c  o m
    return data;
}

From source file:com.appdynamics.cloudfoundry.appdservicebroker.binding.BindingController.java

@RequestMapping(method = RequestMethod.DELETE, value = "/v2/service_instances/*/service_bindings/*")
Map<?, ?> delete(@RequestParam("service_id") String serviceId, @RequestParam("plan_id") String planId) {
    this.logger.info("Un-binding Request Received: service_id: {}, plan_id: {}", serviceId, planId);
    return Collections.emptyMap();
}

From source file:com.cloudmine.api.rest.response.CMObjectResponse.java

/**
 * Instantiate a new CMObjectResponse. You probably should not be calling this yourself.
 * @param response a response to an object fetch request
 *//*from w  ww  . j  a  v  a 2 s.c o m*/
public CMObjectResponse(HttpResponse response) {
    super(response);
    if (hasSuccess()) {
        Map<String, String> messageMap = JsonUtilities.jsonMapToKeyMap(getMessageBody());
        String success = messageMap.get(SUCCESS);
        Map<String, ? extends CMObject> tempMap;
        try {
            tempMap = JsonUtilities.jsonToClassMap(success);
        } catch (ConversionException jce) {
            tempMap = Collections.emptyMap();
            LOG.error("Trouble converting: " + success + ", using empty map");
        }
        objectMap = tempMap;
    } else {
        objectMap = Collections.emptyMap();
    }
}

From source file:com.example.auth.ClientDetailsImpl.java

@Override
public Map<String, Object> getAdditionalInformation() {
    return Collections.emptyMap();
}

From source file:lineage2.gameserver.skills.SkillsEngine.java

/**
 * Method loadAllSkills.//from   w  w  w .ja v a  2  s. c o  m
 * @return Map<Integer,Skill>
 */
public Map<Integer, Skill> loadAllSkills() {
    File dir = new File(Config.DATAPACK_ROOT, "data/xml/stats/skills");
    if (!dir.exists()) {
        _log.info("Dir " + dir.getAbsolutePath() + " not exists");
        return Collections.emptyMap();
    }
    Collection<File> files = FileUtils.listFiles(dir, FileFilterUtils.suffixFileFilter(".xml"),
            FileFilterUtils.directoryFileFilter());
    Map<Integer, Skill> result = new HashMap<>();
    int maxId = 0, maxLvl = 0;
    for (File file : files) {
        List<Skill> s = loadSkills(file);
        if (s == null) {
            continue;
        }
        for (Skill skill : s) {
            result.put(SkillTable.getSkillHashCode(skill), skill);
            if (skill.getId() > maxId) {
                maxId = skill.getId();
            }
            if (skill.getLevel() > maxLvl) {
                maxLvl = skill.getLevel();
            }
        }
    }
    _log.info("SkillsEngine: Loaded " + result.size() + " skill templates from XML files. Max id: " + maxId
            + ", max level: " + maxLvl);
    return result;
}

From source file:org.openmrs.module.metadatasharing.handler.impl.RelationshipTypeHandler.java

@Override
public Map<String, Object> getProperties(RelationshipType object) {
    return Collections.emptyMap();
}

From source file:org.openmrs.module.metadatasharing.handler.impl.RoleHandler.java

@Override
public Map<String, Object> getProperties(Role object) {
    return Collections.emptyMap();
}

From source file:com.nominanuda.springsoy.SoySourceTest.java

@Test
public void testJavaView() throws Exception {
    MockHttpServletRequest req = new MockHttpServletRequest("GET", "/");
    req.addParameter("lang", "en");
    MockHttpServletResponse resp = new MockHttpServletResponse();

    SoyViewResolver viewResolver = new SoyViewResolver();
    viewResolver.setSoySource(soySource);

    LocaleResolver localeResolver = new QueryParamLocaleResolver();
    Locale loc = localeResolver.resolveLocale(req);
    View view = viewResolver.resolveViewName("examples.simple.helloWorld2", loc);
    Map<String, ?> m = Collections.emptyMap();
    view.render(m, req, resp);/*from www .ja v  a  2 s.  c o  m*/
    Assert.assertEquals("Hello world!", resp.getContentAsString());
}

From source file:com.tesobe.obp.transport.json.RequestDecoder.java

@Override
public Map<String, ?> fields() {
    JSONObject fields = json.optJSONObject("fields");

    return fields == null ? Collections.emptyMap() : new FieldDecoder(fields);
}