- java.lang.Object
-
- dagger.internal.DaggerCollections
-
public final class DaggerCollections extends java.lang.ObjectCollection utility methods in service of Dagger internal classes. Do not use in client code.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanhasDuplicates(java.util.List<?> list)Returns true if at least one pair of items inlistare equals.static <K,V>
java.util.LinkedHashMap<K,V>newLinkedHashMapWithExpectedSize(int expectedSize)Creates aLinkedHashMapinstance, with a high enough "initial capacity" that it should holdexpectedSizeelements without growth.static <T> java.util.List<T>presizedList(int size)Returns a new list that is pre-sized tosize, orCollections.emptyList()if empty.
-
-
-
Method Detail
-
presizedList
public static <T> java.util.List<T> presizedList(int size)
Returns a new list that is pre-sized tosize, orCollections.emptyList()if empty. The list returned is never intended to grow beyondsize, so adding to a list when the size is 0 is an error.
-
hasDuplicates
public static boolean hasDuplicates(java.util.List<?> list)
Returns true if at least one pair of items inlistare equals.
-
newLinkedHashMapWithExpectedSize
public static <K,V> java.util.LinkedHashMap<K,V> newLinkedHashMapWithExpectedSize(int expectedSize)
Creates aLinkedHashMapinstance, with a high enough "initial capacity" that it should holdexpectedSizeelements without growth.
-
-