org.eclipse.net4j.util
Class ObjectUtil

java.lang.Object
  extended by org.eclipse.net4j.util.ObjectUtil

public final class ObjectUtil
extends Object

Various static helper methods.


Method Summary
static
<T> T[]
appendtoArray(T[] array, T... elements)
           
static Exception close(Object object)
           
static boolean equals(Object o1, Object o2)
           
static int hashCode(int... values)
          A collision-free hash code for small sets (<=4) of small, positive integers (<=128)
static int hashCode(long num)
           
static int hashCode(Object o)
           
static
<T extends Collection<?>>
boolean
isEmpty(Collection<?> collection)
           
static
<T extends Map<?,?>>
boolean
isEmpty(Map<?,?> map)
           
static boolean isEmpty(String string)
           
static
<T> boolean
isEmpty(T[] array)
           
static
<T> T
notNull(T object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public static boolean equals(Object o1,
                             Object o2)

hashCode

public static int hashCode(Object o)

hashCode

public static int hashCode(int... values)
A collision-free hash code for small sets (<=4) of small, positive integers (<=128)

Since:
3.2

hashCode

public static int hashCode(long num)

appendtoArray

public static <T> T[] appendtoArray(T[] array,
                                    T... elements)

isEmpty

public static <T> boolean isEmpty(T[] array)
Since:
3.1

isEmpty

public static <T extends Map<?,?>> boolean isEmpty(Map<?,?> map)
Since:
3.1

isEmpty

public static <T extends Collection<?>> boolean isEmpty(Collection<?> collection)
Since:
3.1

isEmpty

public static boolean isEmpty(String string)
Since:
3.1

close

public static Exception close(Object object)
Since:
3.3

notNull

public static <T> T notNull(T object)
Since:
3.3


Copyright (c) 2011, 2012 Eike Stepper (Berlin, Germany) and others.