|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sibvisions.util.type.CommonUtil
public final class CommonUtil
The CommonUtil contains utility methods for handling
type independent operations.
| Method Summary | ||
|---|---|---|
static
|
close(Object... pClosable)
Close the given object(s) if closable. |
|
static boolean |
containsException(Throwable pCause,
Class<?> pClass)
Deprecated. since 2.3, use ExceptionUtil.contains(Throwable, Class) instead. |
|
static String |
dump(Throwable pCause,
boolean pDeep)
Deprecated. since 2.3, use ExceptionUtil.dump(Throwable, boolean) instead. |
|
static boolean |
equals(Object pFirst,
Object pSecond)
Indicates whether two object are "equal". |
|
static List<Throwable> |
getCauseList(Throwable pCause)
Deprecated. since 2.3, use ExceptionUtil.getThrowables(Throwable) instead. |
|
static Throwable |
getException(Throwable pCause,
Class<?> pClass)
Deprecated. since 2.3, use ExceptionUtil.getThrowable(Throwable, Class) instead. |
|
static Throwable |
getFirstCause(Throwable pCause)
Deprecated. since 2.3, use ExceptionUtil.getRootCause(Throwable) instead. |
|
static int |
getFreePort(int pMin,
int pMax)
Searchs a free *network* port in the given range. |
|
static int |
getFreePort(int pMin,
int pMax,
boolean pCheckLocal)
Searchs a free port in the given range. |
|
static boolean |
isReachable(String pHost,
int pPort)
Tests if the given port is reachable on the given host. |
|
static
|
nvl(T pValue,
T pNvlValue)
Gets an alternative value for a null object. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
@Deprecated
public static String dump(Throwable pCause,
boolean pDeep)
ExceptionUtil.dump(Throwable, boolean) instead.
pCause - Exception/Throwable (StackTrace)pDeep - true to dump the trace with all causes; false to dump
only the exception
@Deprecated public static Throwable getFirstCause(Throwable pCause)
ExceptionUtil.getRootCause(Throwable) instead.
pCause - the origin cause
@Deprecated public static List<Throwable> getCauseList(Throwable pCause)
ExceptionUtil.getThrowables(Throwable) instead.
pCause - the start exception
@Deprecated
public static boolean containsException(Throwable pCause,
Class<?> pClass)
ExceptionUtil.contains(Throwable, Class) instead.
pCause - the exception (chain)pClass - the expected class
true if the given class or a sub class was found in the exception
chain, false otherwiseClass.isAssignableFrom(Class)
@Deprecated
public static Throwable getException(Throwable pCause,
Class<?> pClass)
ExceptionUtil.getThrowable(Throwable, Class) instead.
pCause - the exception (chain)pClass - the expected class
null if no exception with the given type was foundClass.isAssignableFrom(Class)
public static <T> T nvl(T pValue,
T pNvlValue)
null object.
T - parameter typepValue - desired valuepNvlValue - alternative value
pValue or pNvlValue if pValue == null
public static boolean equals(Object pFirst,
Object pSecond)
null or
the Object.equals(Object) returns true.
If the given objects are of Reference (and not of the same reference)
their value will be compared.
pFirst - an objectpSecond - another object
true if both objects are equal
public static int getFreePort(int pMin,
int pMax)
pMin - the min portpMax - the max port
public static int getFreePort(int pMin,
int pMax,
boolean pCheckLocal)
pMin - the min portpMax - the max portpCheckLocal - true to check local (127.0.0.1) interface as well as network interface (0.0.0.0),
false to check only the network interface
public static boolean isReachable(String pHost,
int pPort)
pHost - the hostname or IPpPort - th port number
true if the port is reachable, false otherwisepublic static <T> T close(Object... pClosable)
T - the closable typepClosable - the object(s) to close
null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||