org.apache.commons.collections.MultiMap.containsKey()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.2k)|赞(0)|评价(0)|浏览(98)

本文整理了Java中org.apache.commons.collections.MultiMap.containsKey()方法的一些代码示例,展示了MultiMap.containsKey()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MultiMap.containsKey()方法的具体详情如下:
包路径:org.apache.commons.collections.MultiMap
类名称:MultiMap
方法名:containsKey

MultiMap.containsKey介绍

暂无

代码示例

代码示例来源:origin: info.magnolia/magnolia-module-cache

@Override
public boolean containsHeader(String name) {
  return headers.containsKey(name);
}

代码示例来源:origin: org.jsmiparser/jsmiparser-util

public boolean containsKey(K key) {
  return m_impl.containsKey(key);
}

代码示例来源:origin: org.apache.cocoon/cocoon-expression-language-impl

private void removeAt(String path, Object value) {
  if (path == null) {
    throw new NullPointerException("Path cannot be null.");
  }
  if (path.length() == 0) {
    throw new IllegalArgumentException("Path cannot be empty");
  }
  Map map = locateMapAt(path, false);
  String key = path.substring(path.lastIndexOf(SEGMENT_SEPARATOR) + 1, path.length());
  if (map == null) {
    return;
  }
  multiValueMapForLocated.remove(key, value);
  if (multiValueMap.containsKey(key)) {
    map.put(key, ((StackReversedIteration) multiValueMap.get(key)).peek());
  } else {
    map.remove(key);
  }
}

代码示例来源:origin: com.atlassian.cache.servlet/atlassian-cache-servlet

if (contentByResolver.containsKey(resolverKey))

代码示例来源:origin: hibernate/hibernate-tools

Object key = iter.next();
if (!specific.containsKey(key) ) {

代码示例来源:origin: org.hibernate/hibernate-tools

Object key = iter.next();
if (!specific.containsKey(key) ) {

代码示例来源:origin: org.apache.directory.shared/shared-ldap

if ( atavTypes.containsKey( normalizedType ) )

代码示例来源:origin: info.magnolia/magnolia-module-cache

public InMemoryCachedEntry(byte[] out, String contentType, String characterEncoding, int statusCode, MultiMap headers, long modificationDate, String originalUrl, int timeToLiveInSeconds) throws IOException {
  super(contentType, characterEncoding, statusCode, headers, modificationDate, originalUrl, timeToLiveInSeconds);
  // content which is actually of a compressed type must stay that way
  if (GZipUtil.isGZipped(out)) {
    this.gzippedContent = out;
    boolean isGzippedResponse = headers.containsKey("Content-Encoding") && ((Collection)headers.get("Content-Encoding")).contains("gzip");
    if(isGzippedResponse){
      this.plainContent = GZipUtil.ungzip(out);
    }
    // in case of serving a gzip file (gif for instance)
    else{
      this.plainContent = null;
    }
  } else {
    this.gzippedContent = GZipUtil.gzip(out);
    this.plainContent = out;
  }
}

代码示例来源:origin: org.apache.directory.shared/shared-ldap

if ( atavTypes.containsKey( normalizedType ) )

代码示例来源:origin: org.jmockring/jmockring-core

/**
 * @param allServers
 * @throws IllegalArgumentException if any of the context configurations are inconsistent
 */
private void validateContextsConfiguration(Server[] allServers) {
  MultiMap bootstraps = new MultiValueMap();
  for (Server serverConfig : allServers) {
    // 1. Validate Class<->Name uniqueness
    if (bootstraps.containsKey(serverConfig.bootstrap())) {
      // server already defined in another context: check name
      Collection allNames = (Collection) bootstraps.get(serverConfig.bootstrap());
      if (allNames.contains(serverConfig.name())) {
        // same class & same name : not good
        throw new IllegalArgumentException(
            String.format("Duplicate server context definition for [%s] and name [%s]. Consider using @Server#name()",
                serverConfig.bootstrap().getName(),
                serverConfig.name())
        );
      }
    }
    bootstraps.put(serverConfig.bootstrap(), serverConfig.name());
    // 2. Check if context is configured
    if (serverConfig.dynamicContexts().length == 0 && serverConfig.webContexts().length == 0) {
      throw new IllegalArgumentException("No context configurations found for execution of class " + serverConfig.bootstrap().getName());
    }
  }
}

代码示例来源:origin: org.apache.cocoon/cocoon-expression-language-impl

public void cleanupLocalContext() {
  if (localContexts.empty()) {
    throw new IllegalStateException("Local contexts stack is empty");
  }
  ArrayStack removeEntries = (ArrayStack)localContexts.pop();
  while (!removeEntries.isEmpty()) {
    if (removeEntries.peek() instanceof PathValue) {
      PathValue entry = (PathValue)removeEntries.pop();
      removeAt(entry.getPath(), entry.getValue());
    } else {
      KeyValue entry = (KeyValue)removeEntries.pop();
      Object key = entry.getKey();
      Object value = entry.getValue();
      multiValueMap.remove(key, value);
      if (multiValueMap.containsKey(key)) {
        singleValueMap.put(key, ((StackReversedIteration) multiValueMap.get(key)).peek());
      } else {
        singleValueMap.remove(key);
      }
    }
  }
}

相关文章