Package ubic.gemma.persistence.util
Class IdentifiableUtils
- java.lang.Object
-
- ubic.gemma.persistence.util.IdentifiableUtils
-
public class IdentifiableUtils extends Object
Utilities forIdentifiable
.- Author:
- poirigui
-
-
Constructor Summary
Constructors Constructor Description IdentifiableUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T,K extends Identifiable,U>
Collector<T,?,Map<K,U>>toIdentifiableMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper)
Collect results into an identifiable map.static <T extends Identifiable>
Collector<T,?,Set<T>>toIdentifiableSet()
Collect results into an identifiable set.static <T extends Identifiable>
StringtoString(T identifiable, Class<T> clazz)
Converts an identifiable to string, avoiding its initialization of it is a proxy.
-
-
-
Method Detail
-
toIdentifiableSet
public static <T extends Identifiable> Collector<T,?,Set<T>> toIdentifiableSet()
Collect results into an identifiable set.This uses
Identifiable.getId()
for comparing elements, making the collection safe for holding proxies unlike aHashSet
that relies onObject.hashCode()
.- See Also:
Collectors.toSet()
-
toIdentifiableMap
public static <T,K extends Identifiable,U> Collector<T,?,Map<K,U>> toIdentifiableMap(Function<? super T,? extends K> keyMapper, Function<? super T,? extends U> valueMapper)
Collect results into an identifiable map.This uses
Identifiable.getId()
for comparing elements, making the collection safe for holding proxies unlike aHashMap
that relies onObject.hashCode()
.
-
toString
public static <T extends Identifiable> String toString(T identifiable, Class<T> clazz)
Converts an identifiable to string, avoiding its initialization of it is a proxy.
-
-