本文整理了Java中java.util.Collections.emptySortedMap()
方法的一些代码示例,展示了Collections.emptySortedMap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Collections.emptySortedMap()
方法的具体详情如下:
包路径:java.util.Collections
类名称:Collections
方法名:emptySortedMap
暂无
代码示例来源:origin: google/guava
@Override
protected SortedMap<String, String> create(Entry<String, String>[] entries) {
return Collections.emptySortedMap();
}
})
代码示例来源:origin: AxonFramework/AxonFramework
/**
* Initializes a new {@link ConsistentHash} using the given {@code hashFunction} to calculate positions for each
* member on the ring. To register members use {@link #with(Member, int, CommandMessageFilter)}.
*
* @param hashFunction The hash function to use to calculate each member's positions on the ring
*/
public ConsistentHash(Function<String, String> hashFunction) {
hashToMember = Collections.emptySortedMap();
members = Collections.emptyMap();
modCount = 0;
this.hashFunction = hashFunction;
}
代码示例来源:origin: wildfly/wildfly
classes.add(Collections.checkedQueue(new LinkedList<>(), Void.class).getClass());
classes.add(Collections.checkedSet(Collections.emptySet(), Void.class).getClass());
classes.add(Collections.checkedSortedMap(Collections.emptySortedMap(), Void.class, Void.class).getClass());
classes.add(Collections.checkedSortedSet(Collections.emptySortedSet(), Void.class).getClass());
classes.add(Collections.synchronizedNavigableSet(Collections.emptyNavigableSet()).getClass());
classes.add(Collections.synchronizedSet(Collections.emptySet()).getClass());
classes.add(Collections.synchronizedSortedMap(Collections.emptySortedMap()).getClass());
classes.add(Collections.synchronizedSortedSet(Collections.emptySortedSet()).getClass());
classes.add(Collections.unmodifiableNavigableSet(Collections.emptyNavigableSet()).getClass());
classes.add(Collections.unmodifiableSet(Collections.emptySet()).getClass());
classes.add(Collections.unmodifiableSortedMap(Collections.emptySortedMap()).getClass());
classes.add(Collections.unmodifiableSortedSet(Collections.emptySortedSet()).getClass());
代码示例来源:origin: wildfly/wildfly
assertTrue(immutability.test(Collections.emptyNavigableSet()));
assertTrue(immutability.test(Collections.emptySet()));
assertTrue(immutability.test(Collections.emptySortedMap()));
assertTrue(immutability.test(Collections.emptySortedSet()));
assertTrue(immutability.test(Boolean.TRUE));
代码示例来源:origin: com.google.guava/guava-testlib
@Override
protected SortedMap<String, String> create(Entry<String, String>[] entries) {
return Collections.emptySortedMap();
}
})
代码示例来源:origin: de.ck35.monitoring/request-tagging-core
public SortedMap<String, String> getMetaData() {
if(metaData == null) {
return Collections.emptySortedMap();
} else {
return metaData;
}
}
代码示例来源:origin: com.aoindustries/ao-dao-base
@Override
public SortedMap<K, ? extends R> getSortedMap() {
return Collections.emptySortedMap();
}
代码示例来源:origin: manoelcampos/cloudsim-plus
@Override public SortedMap<Double, Double> getUtilizationHistorySum() { return Collections.emptySortedMap(); }
@Override public PowerModel getPowerModel() { return PowerModel.NULL; }
代码示例来源:origin: manoelcampos/cloudsim-plus
@Override public SortedMap<Double, Double> getHistory() { return Collections.emptySortedMap(); }
@Override public boolean isEnabled() { return false; }
代码示例来源:origin: manoelcampos/cloudsim-plus
@Override public SortedMap<Double, DoubleSummaryStatistics> getUtilizationHistory() { return Collections.emptySortedMap(); }
@Override public SortedMap<Double, Double> getUtilizationHistorySum() { return Collections.emptySortedMap(); }
代码示例来源:origin: org.axonframework/axon-core
/**
* Initializes a new {@link ConsistentHash} using the given {@code hashFunction} to calculate positions for each
* member on the ring. To register members use {@link #with(Member, int, Predicate)}.
*
* @param hashFunction The hash function to use to calculate each member's positions on the ring
*/
public ConsistentHash(Function<String, String> hashFunction) {
hashToMember = Collections.emptySortedMap();
members = Collections.emptyMap();
modCount = 0;
this.hashFunction = hashFunction;
}
代码示例来源:origin: org.axonframework/axon-messaging
/**
* Initializes a new {@link ConsistentHash} using the given {@code hashFunction} to calculate positions for each
* member on the ring. To register members use {@link #with(Member, int, CommandMessageFilter)}.
*
* @param hashFunction The hash function to use to calculate each member's positions on the ring
*/
public ConsistentHash(Function<String, String> hashFunction) {
hashToMember = Collections.emptySortedMap();
members = Collections.emptyMap();
modCount = 0;
this.hashFunction = hashFunction;
}
代码示例来源:origin: de.ck35.monitoring/request-tagging-core
public Resource(String name, SortedMap<String, String> metaData, List<Measurement> measurements) {
this.name = name;
this.metaData = metaData == null ? Collections.emptySortedMap() : metaData;
this.measurements = Objects.requireNonNull(measurements);
}
代码示例来源:origin: batfish/batfish
@JsonCreator
public NamedStructureEquivalenceSets(
@JsonProperty(PROP_STRUCTURE_CLASS_NAME) String structureClassName) {
_structureClassName = structureClassName;
_sameNamedStructures = Collections.emptySortedMap();
}
代码示例来源:origin: de.ck35.monitoring/request-tagging-core
public void report(StatusReporter reporter) {
report(name, Collections.emptySortedMap(), reporter);
}
}
代码示例来源:origin: org.microbean/microbean-helm
/**
* Creates a new {@link Index}.
*
* @param entries a {@link Map} of {@link SortedSet}s of {@link
* Entry} objects indexed by the name of the Helm chart they
* describe; may be {@code null}; copied by value
*/
Index(final Map<? extends String, ? extends SortedSet<Entry>> entries) {
super();
if (entries == null || entries.isEmpty()) {
this.entries = Collections.emptySortedMap();
} else {
this.entries = Collections.unmodifiableSortedMap(deepCopy(entries));
}
}
代码示例来源:origin: microbean/microbean-helm
/**
* Creates a new {@link Index}.
*
* @param entries a {@link Map} of {@link SortedSet}s of {@link
* Entry} objects indexed by the name of the Helm chart they
* describe; may be {@code null}; copied by value
*/
Index(final Map<? extends String, ? extends SortedSet<Entry>> entries) {
super();
if (entries == null || entries.isEmpty()) {
this.entries = Collections.emptySortedMap();
} else {
this.entries = Collections.unmodifiableSortedMap(deepCopy(entries));
}
}
代码示例来源:origin: com.palantir.tritium/tritium-tags
static SortedMap<String, String> normalizeTags(Map<String, String> tags) {
if (tags.isEmpty()) {
return Collections.emptySortedMap();
}
SortedMap<String, String> normalizedTags = new TreeMap<>();
tags.forEach((key, value) -> {
checkValidTagName(key);
TagPreconditions.checkValidTagComponent(value, DELIMITERS);
String previous = normalizedTags.put(normalizeKey(key), value);
if (previous != null) {
throw new IllegalArgumentException(String.format(
"Invalid tag '%s' with value '%s' duplicates case-insensitive key '%s' with value '%s'",
key, value, key.toLowerCase(), previous));
}
});
return normalizedTags;
}
代码示例来源:origin: vmware/xenon
@Test
public void testEmptyCollectionClone() {
Object target;
target = Collections.emptyList();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptySet();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptyMap();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptyNavigableMap();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptyNavigableSet();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptySortedMap();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
target = Collections.emptySortedSet();
assertCollectionEqualAndUsable(target, cloneWithKryo(target));
}
代码示例来源:origin: com.vmware.xenon/xenon-common
@Test
public void testEmptyCollectionSerialization() {
Object target;
target = Collections.emptyList();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptySet();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptyMap();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptyNavigableMap();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptyNavigableSet();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptySortedMap();
assertCollectionEqualAndUsable(target, serAndDeser(target));
target = Collections.emptySortedSet();
assertCollectionEqualAndUsable(target, serAndDeser(target));
}
内容来源于网络,如有侵权,请联系作者删除!