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:nl.surfnet.spring.security.opensaml.crypt.KeyStoreCredentialResolverDelegate.java

public org.opensaml.xml.security.credential.KeyStoreCredentialResolver getKeyStoreCredentialResolver() {
    Map<String, String> privateKeyPasswords = Collections.emptyMap();
    return new org.opensaml.xml.security.credential.KeyStoreCredentialResolver(certificateStore.getKeyStore(),
            privateKeyPasswords);/* w  w  w .  j av a2  s  . c o  m*/
}

From source file:com.hx.template.http.volley.BaseJsonObjectRequest.java

@Override
public Map<String, String> getHeaders() throws AuthFailureError {
    Map<String, String> headers = super.getHeaders();
    if (null == headers || headers.equals(Collections.emptyMap())) {
        headers = new HashMap<String, String>();
    }/* w ww .j av  a2  s .c  om*/
    if (additionalHeaders != null) {
        headers.putAll(additionalHeaders);
    }
    return headers;
}

From source file:org.jam.metrics.applicationmetrics.utils.DataPoint.java

@JsonCreator(mode = JsonCreator.Mode.PROPERTIES)
public DataPoint(@JsonProperty("timestamp") Long timestamp, @JsonProperty("value") T value) {
    checkArgument(timestamp != null, "Data point timestamp is null");
    checkArgument(value != null, "Data point value is null");
    this.timestamp = timestamp;
    this.value = value;
    tags = Collections.emptyMap();
}

From source file:com.appdynamics.cloudfoundry.appdservicebroker.provisioning.ProvisioningController.java

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

From source file:com.nabla.wapp.report.server.StreamResolvingResourceLocator.java

@Override
public URL findResource(ModuleHandle module, String filename, int type) {
    return findResource(module, filename, type, Collections.emptyMap());
}

From source file:com.woooha.service.music.MusicServiceImpl.java

@Override
public Map<MusicCategory, List<Music>> getHotMusics() {
    List<MusicCategory> recommendCategoris = getRecommendCategoris();
    if (recommendCategoris.isEmpty()) {
        return Collections.emptyMap();
    }// w  w  w .jav  a  2s  .  c  o  m
    Map<MusicCategory, List<Music>> resultMap = new LinkedHashMap<MusicCategory, List<Music>>();
    for (MusicCategory category : recommendCategoris) {
        List<Music> hotMusics = musicDao.getHotMusics(category.getId());
        if (!hotMusics.isEmpty()) {
            resultMap.put(category, hotMusics);
        }
    }
    return resultMap;
}

From source file:pl.raszkowski.sporttrackersconnector.rest.RESTExecutor.java

public String executeGET(String service, String resource) {
    return executeGET(service, resource, Collections.emptyMap());
}

From source file:com.smartling.api.sdk.exceptions.SmartlingApiException.java

public SmartlingApiException(String message, Throwable cause, List<Error> originalErrors) {
    super(message, cause);
    this.originalErrors = originalErrors;
    this.requestId = HttpUtils.getRequestId().get() == null ? "N/A" : HttpUtils.getRequestId().get();

    HttpUtils.ResponseDetails responseDetails = HttpUtils.getResponseDetails().get();
    if (responseDetails != null) {
        this.statusCode = responseDetails.getStatusCode();
        this.responseHeaders = Collections.unmodifiableMap(convertHeadersToMap(responseDetails));
    } else {/*from   w  w  w  . j a v a 2 s. c o m*/
        this.statusCode = 0;
        this.responseHeaders = Collections.emptyMap();
    }
}

From source file:net.hillsdon.reviki.web.vcintegration.AutoProperiesFromConfigPage.java

public Map<String, String> read() {
    try {/* ww  w.  j  a va  2  s .  c  o  m*/
        VersionedPageInfo text = _store.get(CONFIG_AUTO_PROPERTIES, -1);
        return parseAutoProperties(text.getContent());
    } catch (PageStoreException e) {
        LOG.warn("Failed to retrieve the auto-properties page.", e);
        return Collections.emptyMap();
    }
}

From source file:com.github.fge.jackson.JacksonUtils.java

/**
 * Return a map out of an object's members
 *
 * <p>If the node given as an argument is not a map, an empty map is
 * returned.</p>/*from   ww  w .ja va 2s . c  o  m*/
 *
 * @param node the node
 * @return a map
 */
public static Map<String, JsonNode> asMap(final JsonNode node) {
    if (!node.isObject())
        return Collections.emptyMap();

    final Iterator<Map.Entry<String, JsonNode>> iterator = node.fields();
    final Map<String, JsonNode> ret = Maps.newHashMap();

    Map.Entry<String, JsonNode> entry;

    while (iterator.hasNext()) {
        entry = iterator.next();
        ret.put(entry.getKey(), entry.getValue());
    }

    return ret;
}