Package io.debezium.util
Class Collect
- java.lang.Object
-
- io.debezium.util.Collect
-
public class Collect extends Object
A set of utilities for more easily creating various kinds of collections.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Collect()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> List<T>
arrayListOf(Iterable<T> values)
static <T> List<T>
arrayListOf(T[] values)
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>
minus(Set<T> subtrahend, Set<T> minuend)
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
propertiesOf(String key1, String value1, String key2, String value2, String key3, String value3)
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(List<T> list, int index, T value, T defaultValue)
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)
-
-
-
Method Detail
-
fixedSizeMap
public 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. 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
public static <T,V> Set<T> unmodifiableSet(Function<V,T> extractor, Collection<V> values)
-
unmodifiableSet
public static <T> Set<T> unmodifiableSet(T... values)
-
unmodifiableSet
public static <T> Set<T> unmodifiableSet(Collection<T> values)
-
arrayListOf
public static <T> List<T> arrayListOf(T[] values)
-
arrayListOf
public static <T> List<T> arrayListOf(T first, T... additional)
-
mapOf
public static <K,V> Map<K,V> mapOf(K key, V value)
-
hashMapOf
public static <K,V> Map<K,V> hashMapOf(K key, V value)
-
hashMapOf
public static <K,V> Map<K,V> hashMapOf(K key1, V value1, K key2, V value2)
-
hashMapOf
public static <K,V> Map<K,V> hashMapOf(K key1, V value1, K key2, V value2, K key3, V value3)
-
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
public static <K,V> Map<K,V> linkMapOf(K key, V value)
-
linkMapOf
public static <K,V> Map<K,V> linkMapOf(K key1, V value1, K key2, V value2)
-
linkMapOf
public static <K,V> Map<K,V> linkMapOf(K key1, V value1, K key2, V value2, K key3, V value3)
-
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
public static Properties propertiesOf(String key, String value)
-
propertiesOf
public static Properties propertiesOf(String key1, String value1, String key2, String value2)
-
propertiesOf
public static Properties propertiesOf(String key1, String value1, String key2, String value2, String key3, String value3)
-
propertiesOf
public static Properties propertiesOf(String key1, String value1, String key2, String value2, String key3, String value3, String key4, String value4)
-
propertiesOf
public static Properties propertiesOf(String key1, String value1, String key2, String value2, String key3, String value3, String key4, String value4, String key5, String value5)
-
propertiesOf
public 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)
-
set
public static <T> void set(List<T> list, int index, T value, T defaultValue)
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
-
-