|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.hadoop.hbase.util.CollectionUtils
@InterfaceAudience.Private public class CollectionUtils
Utility methods for dealing with Collections, including treating null collections as empty.
Constructor Summary | |
---|---|
CollectionUtils()
|
Method Summary | ||
---|---|---|
static
|
getFirst(Collection<T> collection)
first/last |
|
static
|
getLast(List<T> list)
|
|
static int |
getLastIndex(List<?> list)
|
|
static
|
isEmpty(Collection<T> collection)
empty |
|
static boolean |
isLastIndex(List<?> list,
int index)
|
|
static
|
notEmpty(Collection<T> collection)
|
|
static
|
nullSafe(Collection<T> in)
|
|
static
|
nullSafeSameSize(Collection<A> a,
Collection<B> b)
|
|
static
|
nullSafeSize(Collection<T> collection)
size |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CollectionUtils()
Method Detail |
---|
public static <T> Collection<T> nullSafe(Collection<T> in)
public static <T> int nullSafeSize(Collection<T> collection)
public static <A,B> boolean nullSafeSameSize(Collection<A> a, Collection<B> b)
public static <T> boolean isEmpty(Collection<T> collection)
public static <T> boolean notEmpty(Collection<T> collection)
public static <T> T getFirst(Collection<T> collection)
public static int getLastIndex(List<?> list)
list
- any list
public static boolean isLastIndex(List<?> list, int index)
list
- index
- the index in question
public static <T> T getLast(List<T> list)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |