public class BambooObjectUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T extends Throwable> |
asRuntimeException(T t) |
static <T extends Comparable<T>> |
compare(T lhs,
T rhs)
Compares two objects in a null-safe way.
|
static <T> T |
defaultObject(T object,
T defaultVal) |
static String |
getId(Object o) |
static String |
getMessageOrStackTrace(Throwable throwable)
returns a message from throwable, or, if there's no message create one using exception class name and stack trace
|
static <T extends Throwable,C extends T> |
rethrow(T t,
Class<C> toRethrowC)
Given a Throwable t, and a Trowable toRethrowC, if t is an instance of toRethrowC, it will be rethrown.
|
static <T extends Throwable,C extends T,D extends T> |
rethrow(T t,
Class<C> toRethrowC,
Class<D> toRethrowD)
Given a Throwable t, and a Trowables toRethrowC, toRethrowD, if t is an instance of toRethrowC or toRethrowD, it will be rethrown.
|
static <T extends Throwable> |
rethrowUnexpectedException(T t)
Deprecated.
since 5.0 use
asRuntimeException(Throwable) |
static String |
toString(Object key) |
public static <T extends Comparable<T>> int compare(@Nullable T lhs, @Nullable T rhs)
@NotNull
public static <T> T defaultObject(@Nullable
T object,
@NotNull
T defaultVal)
public static <T extends Throwable,C extends T> RuntimeException rethrow(T t, Class<C> toRethrowC) throws C extends T
C extends T@NotNull public static String getMessageOrStackTrace(@NotNull Throwable throwable)
public static <T extends Throwable,C extends T,D extends T> RuntimeException rethrow(T t, Class<C> toRethrowC, Class<D> toRethrowD) throws C extends T, D extends T
C extends T@Deprecated public static <T extends Throwable> RuntimeException rethrowUnexpectedException(T t)
asRuntimeException(Throwable)public static <T extends Throwable> RuntimeException asRuntimeException(T t)
Copyright © 2016 Atlassian Software Systems Pty Ltd. All rights reserved.