001    /*
002     * $Id: NotFoundException.java,v 1.1 2013/11/11 13:38:47 oboehm Exp $
003     *
004     * Copyright (c) 2013 by Oliver Boehm
005     *
006     * Licensed under the Apache License, Version 2.0 (the "License");
007     * you may not use this file except in compliance with the License.
008     * You may obtain a copy of the License at
009     *
010     *   http://www.apache.org/licenses/LICENSE-2.0
011     *
012     * Unless required by applicable law or agreed to in writing, software
013     * distributed under the License is distributed on an "AS IS" BASIS,
014     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express orimplied.
015     * See the License for the specific language governing permissions and
016     * limitations under the License.
017     *
018     * (c)reated 11.11.2013 by oliver (ob@oasd.de)
019     */
020    
021    package patterntesting.runtime.exception;
022    
023    /**
024     * If you did not find a result and want to avoid 'null" as return value you
025     * can throw this exception here. Like IllegalArgumentException it is derived
026     * from {@link RuntimeException}.
027     *
028     * @author oliver
029     * @since 1.4 (11.11.2013)
030     * @see RuntimeException
031     */
032    public class NotFoundException extends RuntimeException {
033    
034        private static final long serialVersionUID = 20131111L;
035    
036        /**
037         * Instantiates a new not found exception.
038         *
039         * @param notFound the object which was not found
040         */
041        public NotFoundException(final Object notFound) {
042            this("not found: " + notFound);
043        }
044    
045        /**
046         * Instantiates a new not found exception.
047         *
048         * @param msg the msg
049         */
050        public NotFoundException(final String msg) {
051            super(msg);
052        }
053    
054        /**
055         * Instantiates a new not found exception.
056         *
057         * @param t the t
058         */
059        public NotFoundException(final Throwable t) {
060            super(t);
061        }
062    
063        /**
064         * Instantiates a new not found exception.
065         *
066         * @param msg the msg
067         * @param t the t
068         */
069        public NotFoundException(final String msg, final Throwable t) {
070            super(msg, t);
071        }
072    
073    }
074