@Stability.Internal public class TopologyHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
static <V> LinkedHashMap<String,V> |
compressKeyRuns(Map<Integer,V> map)
Returns new map derived by merging contiguous keys that have the same value.
|
public static <V> LinkedHashMap<String,V> compressKeyRuns(Map<Integer,V> map)
START_INCLUSIVE..END_INCLUSIVE
For example:
Given: {0=A, 1=A, 3=A, 4=B, 5=A}
Returns: {0..1=A, 3=A, 4=B, 5=A}
NullPointerException - if map is null or contains a null keyCopyright © 2024 Couchbase, Inc.. All rights reserved.