@Override protected NavigableMap<String, String> create(Entry<String, String>[] entries) { return Collections.unmodifiableNavigableMap(populate(new TreeMap<>(), entries)); } })
@Override @Nullable public NavigableMap<ValueTuple, ? extends LongDiffSets> getSortedIndexUpdates( SchemaDescriptor descriptor ) { if ( indexUpdates == null ) { return null; } Map<ValueTuple, MutableLongDiffSets> updates = indexUpdates.get( descriptor ); if ( updates == null ) { return null; } TreeMap<ValueTuple, MutableLongDiffSets> sortedUpdates; if ( updates instanceof TreeMap ) { sortedUpdates = (TreeMap<ValueTuple, MutableLongDiffSets>) updates; } else { sortedUpdates = new TreeMap<>( ValueTuple.COMPARATOR ); sortedUpdates.putAll( updates ); indexUpdates.put( descriptor, sortedUpdates ); } return Collections.unmodifiableNavigableMap( sortedUpdates ); }
classes.add(Collections.unmodifiableList(nonRandomAccessList).getClass()); classes.add(Collections.unmodifiableMap(Collections.emptyMap()).getClass()); classes.add(Collections.unmodifiableNavigableMap(Collections.emptyNavigableMap()).getClass()); classes.add(Collections.unmodifiableNavigableSet(Collections.emptyNavigableSet()).getClass()); classes.add(Collections.unmodifiableSet(Collections.emptySet()).getClass());
assertTrue(immutability.test(Collections.unmodifiableList(Arrays.asList("1", "2")))); assertTrue(immutability.test(Collections.unmodifiableMap(Collections.singletonMap("1", "2")))); assertTrue(immutability.test(Collections.unmodifiableNavigableMap(new TreeMap<>(Collections.singletonMap("1", "2"))))); assertTrue(immutability.test(Collections.unmodifiableNavigableSet(new TreeSet<>(Collections.singleton("1"))))); assertTrue(immutability.test(Collections.unmodifiableSet(Collections.singleton("1"))));
this.supervisorClasspaths = Collections.unmodifiableNavigableMap(
GetAutoFollowPatternResponse(NavigableMap<String, Pattern> patterns) { this.patterns = Collections.unmodifiableNavigableMap(patterns); }
IndicesFollowStats(NavigableMap<String, List<ShardFollowStats>> shardFollowStats) { this.shardFollowStats = Collections.unmodifiableNavigableMap(shardFollowStats); }
UnitImpl(NavigableMap<String, IExpr> navigableMap) { this.navigableMap = Collections.unmodifiableNavigableMap(navigableMap); }
@Override protected NavigableMap<String, String> create(Entry<String, String>[] entries) { return Collections.unmodifiableNavigableMap(populate(new TreeMap<>(), entries)); } })
@Override public NavigableMap<Long, ReceivedMessage> getMessages(MessageStatus status) { switch(status) { case CREATED: return Collections.unmodifiableNavigableMap(messages.unreadMessages); case READ: return Collections.unmodifiableNavigableMap(messages.readMessages); case DELETED: return Collections.unmodifiableNavigableMap(messages.deletedMessages); default: return Collections.emptyNavigableMap(); } }
/** * Creates a new instance of the StreamSegments class. * * @param segments Segments of a stream, keyed by the largest key in their key range. * i.e. If there are two segments split evenly, the first should have a value of 0.5 and the second 1.0. * @param delegationToken Delegation token to access the segments in the segmentstore */ public StreamSegments(NavigableMap<Double, SegmentWithRange> segments, String delegationToken) { this.segments = Collections.unmodifiableNavigableMap(segments); this.delegationToken = delegationToken; verifySegments(); }
public NavigableMap<K, V> immutable() { return Collections.unmodifiableNavigableMap(build()); }
private NavigableMap<Long, ReceivedMessage> getMessages(long tm, MessageStatus status) { switch(status) { case SENT: return Collections.unmodifiableNavigableMap(messages.unreadMessages.tailMap(tm)); case READ: return Collections.unmodifiableNavigableMap(messages.readMessages.tailMap(tm)); case DELETED: return Collections.unmodifiableNavigableMap(messages.deletedMessages.tailMap(tm)); default: return Collections.emptyNavigableMap(); } }
@Override void lockDownRecurse() { super.lockDownRecurse(); this.schemaFields = Collections.unmodifiableNavigableMap(this.schemaFields); for (SchemaField schemaField : this.schemaFields.values()) schemaField.lockDown(); this.schemaCompositeIndexes = Collections.unmodifiableNavigableMap(this.schemaCompositeIndexes); for (SchemaCompositeIndex schemaCompositeIndex : this.schemaCompositeIndexes.values()) schemaCompositeIndex.lockDown(); }
@Override void lockDownRecurse() { super.lockDownRecurse(); this.schemaFields = Collections.unmodifiableNavigableMap(this.schemaFields); for (SchemaField schemaField : this.schemaFields.values()) schemaField.lockDown(); this.schemaCompositeIndexes = Collections.unmodifiableNavigableMap(this.schemaCompositeIndexes); for (SchemaCompositeIndex schemaCompositeIndex : this.schemaCompositeIndexes.values()) schemaCompositeIndex.lockDown(); }
public static HashStreamRanges ofHash(RangeKeyType keyType, NavigableMap<Long, RangeProperties> ranges) { checkArgument(RangeKeyType.HASH == keyType, "Only hash routing is supported now. %s is not supported.", keyType); NavigableMap<Long, RangeProperties> readOnlyRanges = Collections.unmodifiableNavigableMap(ranges); long maxRangeId = 0L; for (RangeProperties props : ranges.values()) { maxRangeId = Math.max(maxRangeId, props.getRangeId()); } return new HashStreamRanges(readOnlyRanges, maxRangeId); }
@Override void lockDownRecurse() { super.lockDownRecurse(); this.schemaObjectTypes = Collections.unmodifiableNavigableMap(this.schemaObjectTypes); for (SchemaObjectType schemaObjectType : this.schemaObjectTypes.values()) schemaObjectType.lockDown(); }
@Override void lockDownRecurse() { super.lockDownRecurse(); this.schemaObjectTypes = Collections.unmodifiableNavigableMap(this.schemaObjectTypes); for (SchemaObjectType schemaObjectType : this.schemaObjectTypes.values()) schemaObjectType.lockDown(); }
private NavigableMap<Long, byte[]> getMapForReading(final MapDBTransaction tx) { checkNotNull(tx, "Precondition violation - argument 'tx' must not be NULL!"); String mapName = this.getBranchName() + MAP_SUFFIX; if (tx.exists(mapName)) { return Collections.unmodifiableNavigableMap(tx.treeMap(mapName, Serializer.LONG, Serializer.BYTE_ARRAY)); } else { return Collections.emptyNavigableMap(); } }
/** Returns a map containing all the entries in the map that match the given * name. If case-sensitive, that map will have 0 or 1 elements; if * case-insensitive, it may have 0 or more. */ public NavigableMap<String, V> range(String name, boolean caseSensitive) { Object floorKey; Object ceilingKey; if (caseSensitive) { floorKey = name; ceilingKey = name; } else { floorKey = COMPARATOR.floorKey(name); ceilingKey = COMPARATOR.ceilingKey(name); } NavigableMap subMap = ((NavigableMap) map).subMap(floorKey, true, ceilingKey, true); return Collections.unmodifiableNavigableMap((NavigableMap<String, V>) subMap); }