com.hazelcast.core.MultiMap.containsKey()方法的使用及代码示例

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

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

MultiMap.containsKey介绍

[英]Returns whether the multimap contains an entry with the key.

Warning: This method uses hashCode and equals of the binary form of the key, not the actual implementations of hashCode and equals defined in the key's class.
[中]返回多重映射是否包含带键的项。
警告:此方法使用密钥二进制形式的hashCode和equals,而不是密钥类中定义的hashCode和equals的实际实现。

代码示例

代码示例来源:origin: org.apache.camel/camel-hazelcast

private void containsKey(Object oid, Exchange exchange) {
  exchange.getOut().setBody(this.cache.containsKey(oid));
}

代码示例来源:origin: jclawson/hazeltask

public boolean containsKey(K key) {
  if(guavaMultiMap != null)
    return guavaMultiMap.containsKey(key);
  return hcMultiMap.containsKey(key);
}

代码示例来源:origin: com.thinkaurelius.titan/titan-hazelcast

@Override
public boolean containsKey(StaticBuffer key, StoreTransaction txh) throws StorageException {
  return cache.containsKey(key.as(StaticArrayBuffer.ARRAY_FACTORY));
}

代码示例来源:origin: spring-projects/spring-integration-extensions

.getMultiMap(HazelcastLocalInstanceRegistrar.SPRING_INTEGRATION_INTERNAL_CLUSTER_MULTIMAP);
if (configMultiMap.containsKey(removedMemberSocketAddress)) {
  SocketAddress newAdminSocketAddress = getNewAdminInstanceSocketAddress(
      configMultiMap, removedMemberSocketAddress);

代码示例来源:origin: hazelcast/hazelcast-jet

protected void handleContains(String[] args) {
  String iteratorStr = args[0];
  boolean key = lowerCaseInternal(iteratorStr).endsWith("key");
  String data = args[1];
  boolean result = false;
  if (iteratorStr.startsWith("s.")) {
    result = getSet().contains(data);
  } else if (iteratorStr.startsWith("m.")) {
    result = (key) ? getMap().containsKey(data) : getMap().containsValue(data);
  } else if (iteratorStr.startsWith("mmm.")) {
    result = (key) ? getMultiMap().containsKey(data) : getMultiMap().containsValue(data);
  } else if (iteratorStr.startsWith("q.")) {
    result = getQueue().contains(data);
  } else if (iteratorStr.startsWith("l.")) {
    result = getList().contains(data);
  }
  println("Contains: " + result);
}

代码示例来源:origin: hazelcast/hazelcast-jet

protected void handleContains(String[] args) {
  String iteratorStr = args[0];
  boolean key = lowerCaseInternal(iteratorStr).endsWith("key");
  String data = args[1];
  boolean result = false;
  if (iteratorStr.startsWith("s.")) {
    result = getSet().contains(data);
  } else if (iteratorStr.startsWith("m.")) {
    result = (key) ? getMap().containsKey(data) : getMap().containsValue(data);
  } else if (iteratorStr.startsWith("mmm.")) {
    result = (key) ? getMultiMap().containsKey(data) : getMultiMap().containsValue(data);
  } else if (iteratorStr.startsWith("q.")) {
    result = getQueue().contains(data);
  } else if (iteratorStr.startsWith("l.")) {
    result = getList().contains(data);
  }
  println("Contains: " + result);
}

代码示例来源:origin: com.hazelcast/hazelcast-all

protected void handleContains(String[] args) {
  String iteratorStr = args[0];
  boolean key = lowerCaseInternal(iteratorStr).endsWith("key");
  String data = args[1];
  boolean result = false;
  if (iteratorStr.startsWith("s.")) {
    result = getSet().contains(data);
  } else if (iteratorStr.startsWith("m.")) {
    result = (key) ? getMap().containsKey(data) : getMap().containsValue(data);
  } else if (iteratorStr.startsWith("mmm.")) {
    result = (key) ? getMultiMap().containsKey(data) : getMultiMap().containsValue(data);
  } else if (iteratorStr.startsWith("q.")) {
    result = getQueue().contains(data);
  } else if (iteratorStr.startsWith("l.")) {
    result = getList().contains(data);
  }
  println("Contains: " + result);
}

代码示例来源:origin: com.hazelcast/hazelcast-all

protected void handleContains(String[] args) {
  String iteratorStr = args[0];
  boolean key = lowerCaseInternal(iteratorStr).endsWith("key");
  String data = args[1];
  boolean result = false;
  if (iteratorStr.startsWith("s.")) {
    result = getSet().contains(data);
  } else if (iteratorStr.startsWith("m.")) {
    result = (key) ? getMap().containsKey(data) : getMap().containsValue(data);
  } else if (iteratorStr.startsWith("mmm.")) {
    result = (key) ? getMultiMap().containsKey(data) : getMultiMap().containsValue(data);
  } else if (iteratorStr.startsWith("q.")) {
    result = getQueue().contains(data);
  } else if (iteratorStr.startsWith("l.")) {
    result = getList().contains(data);
  }
  println("Contains: " + result);
}

相关文章