|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Throwable
java.lang.Exception
it.tidalwave.util.NotFoundException
public class NotFoundException
Notifies that a searched object couldn't be found.
Constructor Summary | |
---|---|
NotFoundException()
|
|
NotFoundException(java.lang.String message)
|
|
NotFoundException(java.lang.String message,
java.lang.Throwable throwable)
|
|
NotFoundException(java.lang.Throwable throwable)
|
Method Summary | ||
---|---|---|
static
|
throwWhenEmpty(T collection,
java.lang.String message)
Throws the NotFoundException when the passed collection is null or empty. |
|
static
|
throwWhenEmpty(T collection,
java.lang.String message,
java.lang.Object... args)
Throws the NotFoundException when the passed collection is null or empty. |
|
static
|
throwWhenNull(T object,
java.lang.String message)
Throws the NotFoundException when the passed object is null . |
|
static
|
throwWhenNull(T object,
java.lang.String message,
java.lang.Object... args)
Throws the NotFoundException when the passed object is null . |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NotFoundException()
public NotFoundException(@Nonnull java.lang.String message)
public NotFoundException(@Nonnull java.lang.Throwable throwable)
public NotFoundException(@Nonnull java.lang.String message, @Nonnull java.lang.Throwable throwable)
Method Detail |
---|
@Nonnull public static <T> T throwWhenNull(@Nullable T object, @Nonnull java.lang.String message) throws NotFoundException
NotFoundException
when the passed object is null
. The method returns the object
itself and thus it can be used with fluent interfaces.
object
- the object to be testedmessage
- the error message to be thrown
NotFoundException
- if the object is null@Nonnull public static <T> T throwWhenNull(@Nullable T object, @Nonnull java.lang.String message, @Nonnull java.lang.Object... args) throws NotFoundException
NotFoundException
when the passed object is null
. The method returns the object
itself and thus it can be used with fluent interfaces.
object
- the object to be testedmessage
- the error message to be thrown (formatted as in String.format(java.lang.String, java.lang.Object...)
args
- the arguments to format the error message
NotFoundException
- if the object is null@Nonnull public static <T extends java.util.Collection<?>> T throwWhenEmpty(@Nullable T collection, @Nonnull java.lang.String message) throws NotFoundException
NotFoundException
when the passed collection is null
or empty. The method returns the
collection itself and thus it can be used with fluent interfaces.
object
- the collection to be testedmessage
- the error message to be thrown
NotFoundException
- if the collection is null or empty@Nonnull public static <T extends java.util.Collection<?>> T throwWhenEmpty(@Nullable T collection, @Nonnull java.lang.String message, @Nonnull java.lang.Object... args) throws NotFoundException
NotFoundException
when the passed collection is null
or empty. The method returns the
collection itself and thus it can be used with fluent interfaces.
object
- the collection to be testedmessage
- the error message to be thrown (formatted as in String.format(java.lang.String, java.lang.Object...)
args
- the arguments to format the error message
NotFoundException
- if the collection is null or empty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |