Package io.debezium.util
Class Collect
java.lang.Object
io.debezium.util.Collect
A set of utilities for more easily creating various kinds of collections.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>
arrayListOf
(Iterable<T> values) static <T> List<T>
arrayListOf
(T[] values) static <T> List<T>
arrayListOf
(T first, List<T> additional) static <T> List<T>
arrayListOf
(T first, T... additional) static <K,
V> Map<K, V> fixedSizeMap
(int maximumNumberOfEntries) Create a fixed sized Map that removes the least-recently used entry when the map becomes too large.static <K,
V> Map<K, V> hashMapOf
(K key, V value) static <K,
V> Map<K, V> hashMapOf
(K key1, V value1, K key2, V value2) static <K,
V> Map<K, V> hashMapOf
(K key1, V value1, K key2, V value2, K key3, V value3) static <K,
V> Map<K, V> hashMapOf
(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4) static <K,
V> Map<K, V> hashMapOf
(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5) static <K,
V> Map<K, V> hashMapOf
(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5, K key6, V value6) static <K,
V> Map<K, V> linkMapOf
(K key, V value) static <K,
V> Map<K, V> linkMapOf
(K key1, V value1, K key2, V value2) static <K,
V> Map<K, V> linkMapOf
(K key1, V value1, K key2, V value2, K key3, V value3) static <K,
V> Map<K, V> linkMapOf
(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4) static <K,
V> Map<K, V> mapOf
(K key, V value) static <T> Set<T>
Remove the content of one set from an another one.static Properties
propertiesOf
(String key, String value) static Properties
propertiesOf
(String key1, String value1, String key2, String value2) static Properties
static Properties
propertiesOf
(String key1, String value1, String key2, String value2, String key3, String value3, String key4, String value4) static Properties
propertiesOf
(String key1, String value1, String key2, String value2, String key3, String value3, String key4, String value4, String key5, String value5) static Properties
propertiesOf
(String key1, String value1, String key2, String value2, String key3, String value3, String key4, String value4, String key5, String value5, String key6, String value6) static <T> void
Set the value at the given position in the list, expanding the list as required to accommodate the new position.static <T> Set<T>
unmodifiableSet
(Collection<T> values) static <T,
V> Set<T> unmodifiableSet
(Function<V, T> extractor, Collection<V> values) static <T,
V> Set<T> unmodifiableSet
(Function<V, T> extractor, V... values) static <T> Set<T>
unmodifiableSet
(Iterator<T> values) static <T> Set<T>
unmodifiableSet
(Set<T> values) static <T> Set<T>
unmodifiableSet
(Set<T> values, T... additionalValues) static <T> Set<T>
unmodifiableSet
(T... values)
-
Constructor Details
-
Collect
private Collect()
-
-
Method Details
-
fixedSizeMap
Create a fixed sized Map that removes the least-recently used entry when the map becomes too large. The suppliedmaximumNumberOfEntries
should be a power of 2 to efficiently make efficient use of memory. If not, the resulting map will be able to contain no more thanmaximumNumberOfEntries
entries, but the underlying map will have a capacity that is the next power of larger than the suppliedmaximumNumberOfEntries
value so that it can hold the required number of entries.- Parameters:
maximumNumberOfEntries
- the maximum number of entries allowed in the map; should be a power of 2- Returns:
- the map that is limited in size by the specified number of entries; never null
-
unmodifiableSet
-
unmodifiableSet
-
unmodifiableSet
-
unmodifiableSet
-
unmodifiableSet
-
unmodifiableSet
-
unmodifiableSet
-
arrayListOf
-
arrayListOf
-
arrayListOf
-
arrayListOf
-
mapOf
-
hashMapOf
-
hashMapOf
-
hashMapOf
-
hashMapOf
public static <K,V> Map<K,V> hashMapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4) -
hashMapOf
public static <K,V> Map<K,V> hashMapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5) -
hashMapOf
public static <K,V> Map<K,V> hashMapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4, K key5, V value5, K key6, V value6) -
linkMapOf
-
linkMapOf
-
linkMapOf
-
linkMapOf
public static <K,V> Map<K,V> linkMapOf(K key1, V value1, K key2, V value2, K key3, V value3, K key4, V value4) -
propertiesOf
-
propertiesOf
-
propertiesOf
-
propertiesOf
-
propertiesOf
-
propertiesOf
-
set
Set the value at the given position in the list, expanding the list as required to accommodate the new position.This is not a thread-safe operation
- Parameters:
list
- the list to be modifiedindex
- the index position of the new valuevalue
- the valuedefaultValue
- the value used for intermediate positions when expanding the list; may be null
-
minus
Remove the content of one set from an another one.- Parameters:
subtrahend
- the main setminuend
- the elements to be removed
-