Class NotFoundException

  • All Implemented Interfaces:
    java.io.Serializable

    public class NotFoundException
    extends java.util.NoSuchElementException
    If you did not find a result and want to avoid 'null" as return value you can throw this exception here. Since 1.5 it is no longer derived direct from RuntimeException but NoSuchElementException. The reason for this change is a missing constructor like NotFoundException(String, Throwable) in NoSuchElementException.
    Since:
    1.4 (11.11.2013)
    Author:
    oliver
    See Also:
    RuntimeException, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      NotFoundException​(java.lang.Object value)
      Instantiates a new not found exception.
      NotFoundException​(java.lang.String msg)
      Instantiates a new not found exception.
      NotFoundException​(java.lang.String msg, java.lang.Throwable t)
      Instantiates a new not found exception.
      NotFoundException​(java.lang.Throwable t)
      Instantiates a new not found exception.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Throwable getCause()
      Gets the stored cause.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, 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

      • NotFoundException

        public NotFoundException​(java.lang.Object value)
        Instantiates a new not found exception.
        Parameters:
        value - the object which was not found
      • NotFoundException

        public NotFoundException​(java.lang.String msg)
        Instantiates a new not found exception.
        Parameters:
        msg - the msg
      • NotFoundException

        public NotFoundException​(java.lang.Throwable t)
        Instantiates a new not found exception.
        Parameters:
        t - the cause
      • NotFoundException

        public NotFoundException​(java.lang.String msg,
                                 java.lang.Throwable t)
        Instantiates a new not found exception.
        Parameters:
        msg - the msg
        t - the cause
    • Method Detail

      • getCause

        public java.lang.Throwable getCause()
        Gets the stored cause.
        Overrides:
        getCause in class java.lang.Throwable
        Returns:
        the cause
        See Also:
        Throwable.getCause()