Example usage for java.util Map remove

List of usage examples for java.util Map remove

Introduction

In this page you can find the example usage for java.util Map remove.

Prototype

V remove(Object key);

Source Link

Document

Removes the mapping for a key from this map if it is present (optional operation).

Usage

From source file:com.amazonaws.services.simpleworkflow.flow.spring.WorkflowScope.java

@Override
public Object remove(String name) {
    Map<String, Object> map = objects.get();
    return map.remove(name);
}

From source file:org.molasdin.wbase.jsf.spring.scope.JsfFlowScope.java

@Override
public Object remove(String s) {
    Map<Object, Object> scope = flowScope();
    if (scope == null) {
        return null;
    }/*w  w w.  j a  va 2s  .  c om*/
    return scope.remove(s);
}

From source file:org.atemsource.atem.impl.common.attribute.MapAttributeImpl.java

@Override
public void removeKey(Object entity, K key) {
    Map map = getValue(entity);
    map.remove(key);

}

From source file:de.innovationgate.wgpublisher.webtml.portlet.TMLPortletStateSessionStorage.java

@Override
public void disposeState(String appDb, String portletKey) {
    // Remove the session context
    String completeKey = getSessionContextKey(appDb, portletKey);

    synchronized (_session) {
        Map<String, TMLPortletState> contexts = getSessionMap();
        contexts.remove(completeKey);
    }//from   w ww.  ja  v a 2s .c o  m
}

From source file:com.btmatthews.atlas.tenancy.support.spring.TenantScope.java

/**
 * Remove a tenant scoped bean for the current application context.
 *
 * @param name The name of the tenant scoped bean.
 * @return The matching bean or {@code null} if the bean was not found in the application context.
 *///  w  ww.j  av a 2  s. com
@Override
public Object remove(final String name) {
    final String tenantId = getConversationId();
    if (tenantId != null && scopes.containsKey(tenantId)) {
        final Map<String, Object> scope = scopes.get(tenantId);
        return scope.remove(name);
    } else {
        return null;
    }
}

From source file:io.wcm.devops.conga.plugins.aem.handlebars.helper.AbstractFilter.java

/**
 * Gets and removes value from map.// w ww.  ja va  2s .c o m
 * @param map Map
 * @param key Key
 * @return Value or null if not set
 */
protected final String getValue(Map<String, Object> map, String key) {
    // get and remove value from map
    Object value = map.remove(key);
    if (value instanceof String) {
        return (String) value;
    } else {
        return null;
    }
}

From source file:com.cognifide.cq.cqsm.core.scripts.ScriptReplicatorImpl.java

private Resource copy(ResourceResolver resolver, String sourcePath, Resource destParent)
        throws PersistenceException {
    Resource source = resolver.getResource(sourcePath);

    Map<String, Object> properties = Maps.newHashMap(source.getValueMap());
    properties.remove(JcrConstants.JCR_UUID);
    Resource dest = resolver.create(destParent, source.getName(), properties);

    if (source.getChild(JcrConstants.JCR_CONTENT) != null) {
        copy(resolver, sourcePath + "/" + JcrConstants.JCR_CONTENT, dest);
    }//from www .  ja  v  a2s .com
    return dest;
}

From source file:com.baidu.cc.configuration.bo.ConfigGroup.java

/**
 * Copy value to {@link JsonObject}.//from  w  w w  .  jav  a2s  . co  m
 * 
 * @return json object
 */
public JsonObject copyToJson() {
    Map<String, Object> map = toMap();
    // ingore date
    map.remove("createTime");
    map.remove("updateTime");
    return JsonUtils.fromSimpleMap(map);
}

From source file:com.liferay.ci.jenkins.cache.LiferayJenkinsBuildCache.java

public JSONArray remove(String portletId, Object key) {
    Map<String, JSONArray> portletCache = _getPortletCache(portletId);

    return portletCache.remove(key);
}

From source file:com.visural.domo.spring.TransactionScope.java

public Object remove(String key) {
    Map<String, Object> scopedObjects = getScopedObjectMap(key);
    return scopedObjects.remove(key);
}