public final class ObjectUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <T> T[] |
appendtoArray(T[] array,
T... elements) |
static java.lang.Exception |
close(java.lang.Object object) |
static boolean |
equals(java.lang.Object o1,
java.lang.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(java.lang.Object o) |
static <T extends java.util.Collection<?>> |
isEmpty(java.util.Collection<?> collection) |
static <T extends java.util.Map<?,?>> |
isEmpty(java.util.Map<?,?> map) |
static boolean |
isEmpty(java.lang.String string) |
static <T> boolean |
isEmpty(T[] array) |
static boolean |
never() |
static <T> T |
notNull(T object) |
static <T> T |
tryCast(java.lang.Object object,
java.lang.Class<T> type)
Attempts to cast an
object as an instance of the given type . |
public static boolean never()
public static boolean equals(java.lang.Object o1, java.lang.Object o2)
public static int hashCode(java.lang.Object o)
public static int hashCode(int... values)
public static int hashCode(long num)
public static <T> T[] appendtoArray(T[] array, T... elements)
public static <T> boolean isEmpty(T[] array)
public static <T extends java.util.Map<?,?>> boolean isEmpty(java.util.Map<?,?> map)
public static <T extends java.util.Collection<?>> boolean isEmpty(java.util.Collection<?> collection)
public static boolean isEmpty(java.lang.String string)
public static java.lang.Exception close(java.lang.Object object)
public static <T> T notNull(T object)
public static <T> T tryCast(java.lang.Object object, java.lang.Class<T> type)
object
as an instance of the given type
.object
- an object to cast to some type
type
- the type to cast the object
toobject
or null
if it is not of the required type
Copyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html