Package org.aksw.commons.index.util
Interface ListSupplier
-
public interface ListSupplierHelper interface for creating new set instances with automatically inferred types- Author:
- Claus Stadler 11/09/2020
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static ListSupplierforceCast(java.util.function.Supplier<Set<?>> listSupplier)Force cast to the requested type.<V> List<V>get()static ListSuppliernone()A supplier that supplies null instead of set instances.
-
-
-
Method Detail
-
get
<V> List<V> get()
-
none
static ListSupplier none()
A supplier that supplies null instead of set instances. In nested structures such null values may act as placeholders that are replaced in a post-processing step.- Returns:
- 'null' casted to the appropriate type.
-
forceCast
static ListSupplier forceCast(java.util.function.Supplier<Set<?>> listSupplier)
Force cast to the requested type. Useful for e.g. TreeSets: While e.g. HashSet::new can supply set instances for any generic type, TreeSets are dependent on a comparator which may only work with specific types.- Parameters:
setSupplier-- Returns:
-
-