@Override protected SortedMap<String, String> create(Entry<String, String>[] entries) { return Collections.emptySortedMap(); } })
/** * 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; }
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());
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));
@Override protected SortedMap<String, String> create(Entry<String, String>[] entries) { return Collections.emptySortedMap(); } })
public SortedMap<String, String> getMetaData() { if(metaData == null) { return Collections.emptySortedMap(); } else { return metaData; } }
@Override public SortedMap<K, ? extends R> getSortedMap() { return Collections.emptySortedMap(); }
@Override public SortedMap<Double, Double> getUtilizationHistorySum() { return Collections.emptySortedMap(); } @Override public PowerModel getPowerModel() { return PowerModel.NULL; }
@Override public SortedMap<Double, Double> getHistory() { return Collections.emptySortedMap(); } @Override public boolean isEnabled() { return false; }
@Override public SortedMap<Double, DoubleSummaryStatistics> getUtilizationHistory() { return Collections.emptySortedMap(); } @Override public SortedMap<Double, Double> getUtilizationHistorySum() { return Collections.emptySortedMap(); }
/** * 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; }
/** * 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; }
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); }
@JsonCreator public NamedStructureEquivalenceSets( @JsonProperty(PROP_STRUCTURE_CLASS_NAME) String structureClassName) { _structureClassName = structureClassName; _sameNamedStructures = Collections.emptySortedMap(); }
public void report(StatusReporter reporter) { report(name, Collections.emptySortedMap(), reporter); } }
/** * 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)); } }
/** * 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)); } }
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; }
@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)); }
@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)); }