本文整理了Java中com.google.common.collect.Maps.safeContainsKey()
方法的一些代码示例,展示了Maps.safeContainsKey()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Maps.safeContainsKey()
方法的具体详情如下:
包路径:com.google.common.collect.Maps
类名称:Maps
方法名:safeContainsKey
[英]Delegates to Map#containsKey. Returns false on ClassCastException and NullPointerException.
[中]代表们映射#containsKey。在ClassCastException和NullPointerException上返回false。
代码示例来源:origin: google/guava
@Override
public boolean containsColumn(@Nullable Object columnKey) {
if (columnKey == null) {
return false;
}
for (Map<C, V> map : backingMap.values()) {
if (safeContainsKey(map, columnKey)) {
return true;
}
}
return false;
}
代码示例来源:origin: google/guava
@Override
public boolean containsRow(@Nullable Object rowKey) {
return rowKey != null && safeContainsKey(backingMap, rowKey);
}
代码示例来源:origin: google/j2objc
@Override
public boolean containsColumn(@NullableDecl Object columnKey) {
if (columnKey == null) {
return false;
}
for (Map<C, V> map : backingMap.values()) {
if (safeContainsKey(map, columnKey)) {
return true;
}
}
return false;
}
代码示例来源:origin: google/j2objc
@Override
public boolean containsRow(@NullableDecl Object rowKey) {
return rowKey != null && safeContainsKey(backingMap, rowKey);
}
代码示例来源:origin: google/guava
@Override
public boolean containsRow(@Nullable Object rowKey) {
return Maps.safeContainsKey(rowMap(), rowKey);
}
代码示例来源:origin: google/guava
@Override
public boolean containsColumn(@Nullable Object columnKey) {
return Maps.safeContainsKey(columnMap(), columnKey);
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean containsColumn(@NullableDecl Object columnKey) {
if (columnKey == null) {
return false;
}
for (Map<C, V> map : backingMap.values()) {
if (safeContainsKey(map, columnKey)) {
return true;
}
}
return false;
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean containsRow(@NullableDecl Object rowKey) {
return rowKey != null && safeContainsKey(backingMap, rowKey);
}
代码示例来源:origin: google/j2objc
@Override
public boolean containsColumn(@NullableDecl Object columnKey) {
return Maps.safeContainsKey(columnMap(), columnKey);
}
代码示例来源:origin: google/j2objc
@Override
public boolean containsRow(@NullableDecl Object rowKey) {
return Maps.safeContainsKey(rowMap(), rowKey);
}
代码示例来源:origin: google/guava
@Override
public boolean contains(@Nullable Object rowKey, @Nullable Object columnKey) {
Map<C, V> row = Maps.safeGet(rowMap(), rowKey);
return row != null && Maps.safeContainsKey(row, columnKey);
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean containsRow(@NullableDecl Object rowKey) {
return Maps.safeContainsKey(rowMap(), rowKey);
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean containsColumn(@NullableDecl Object columnKey) {
return Maps.safeContainsKey(columnMap(), columnKey);
}
代码示例来源:origin: google/j2objc
@Override
public boolean contains(@NullableDecl Object rowKey, @NullableDecl Object columnKey) {
Map<C, V> row = Maps.safeGet(rowMap(), rowKey);
return row != null && Maps.safeContainsKey(row, columnKey);
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean contains(@NullableDecl Object rowKey, @NullableDecl Object columnKey) {
Map<C, V> row = Maps.safeGet(rowMap(), rowKey);
return row != null && Maps.safeContainsKey(row, columnKey);
}
代码示例来源:origin: com.google.guava/guava-jdk5
@Override public boolean containsColumn(@Nullable Object columnKey) {
if (columnKey == null) {
return false;
}
for (Map<C, V> map : backingMap.values()) {
if (safeContainsKey(map, columnKey)) {
return true;
}
}
return false;
}
代码示例来源:origin: org.sonatype.sisu/sisu-guava
@Override public boolean containsColumn(@Nullable Object columnKey) {
if (columnKey == null) {
return false;
}
for (Map<C, V> map : backingMap.values()) {
if (safeContainsKey(map, columnKey)) {
return true;
}
}
return false;
}
代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.google.guava
@Override public boolean containsColumn(@Nullable Object columnKey) {
if (columnKey == null) {
return false;
}
for (Map<C, V> map : backingMap.values()) {
if (safeContainsKey(map, columnKey)) {
return true;
}
}
return false;
}
代码示例来源:origin: com.diffplug.guava/guava-collect
@Override
public boolean containsColumn(@Nullable Object columnKey) {
if (columnKey == null) {
return false;
}
for (Map<C, V> map : backingMap.values()) {
if (safeContainsKey(map, columnKey)) {
return true;
}
}
return false;
}
代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby
@Override
public boolean contains(@Nullable Object rowKey, @Nullable Object columnKey) {
Map<C, V> row = Maps.safeGet(rowMap(), rowKey);
return row != null && Maps.safeContainsKey(row, columnKey);
}
内容来源于网络,如有侵权,请联系作者删除!