java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.github.mmm.base.exception.ApplicationException
io.github.mmm.base.exception.ObjectNotFoundException
- All Implemented Interfaces:
Localizable,LocalizableObject,Serializable
An
This typically happens in situations where required objects are requested by a key (e.g. in a registry-
If you design your API consider carefully if you should return
ObjectNotFoundException is thrown if an object was requested but does not exist or could not be found.
This typically happens in situations where required objects are requested by a key (e.g. in a registry-
Map) but an expected object was not registered or the key is wrong for some reason. If you design your API consider carefully if you should return
null or throw an
ObjectNotFoundException.- Since:
- 1.0.0
- See Also:
-
Field Summary
FieldsFields inherited from interface io.github.mmm.base.i18n.Localizable
BUNDLE_PREFIX -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedObjectNotFoundException(Localizable message, Throwable cause) The constructor.ObjectNotFoundException(Object object) The constructor.ObjectNotFoundException(Object object, Object key) The constructor.ObjectNotFoundException(Object object, Object key, Object options, Throwable cause) The constructor.ObjectNotFoundException(Object object, Object key, Throwable cause) The constructor. -
Method Summary
Methods inherited from class io.github.mmm.base.exception.ApplicationException
createUuid, getLocalizedMessage, getLocalizedMessage, getLocalizedMessage, getMessage, getNlsMessage, getNlsMessage, getUuid, isForUser, isTechnical, printStackTrace, toString, toString, toStringMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTraceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.github.mmm.base.i18n.Localizable
getArgument, toLocalizable
-
Field Details
-
MESSAGE_CODE
- See Also:
-
-
Constructor Details
-
ObjectNotFoundException
The constructor.- Parameters:
object- the description (e.g. the classname) of the object that was required but could NOT be found.
-
ObjectNotFoundException
The constructor.- Parameters:
object- the description (e.g. the classname) of the object that was required but could NOT be found.key- the key to the required object.
-
ObjectNotFoundException
The constructor.- Parameters:
object- the description (e.g. the classname) of the object that was required but could NOT be found.key- the key to the required object.cause- thecauseof this exception.
-
ObjectNotFoundException
The constructor.- Parameters:
object- the description (e.g. the classname) of the object that was required but could NOT be found.key- the key to the required object.options- the available options (e.g.Collectionof comma separatedStringof the available keys).cause- thecauseof this exception.
-
ObjectNotFoundException
The constructor.- Parameters:
message- theNLS message.cause- thecauseof this exception. May benull.
-
-
Method Details
-
getCode
Description copied from class:ApplicationExceptionThis method gets the code that identifies the detailed type of this object. WhileUUIDis unique per instance of aApplicationExceptionthis code is a short and readable identifier representing theApplicationExceptionClass. The default implementation returns thesimple name. However, the code should remain stable after refactoring (so at least after the rename the previous code should be returned asStringliteral). This code may be used as a compact identifier to reference the related problem or information as well as for automatic tests of error situations that should remain stable even if the message text gets improved or the locale is unknown.- Overrides:
getCodein classApplicationException- Returns:
- the error code.
-