001/*
002 * ============================================================================
003 *  Copyright © 2002-2020 by Thomas Thrien.
004 *  All Rights Reserved.
005 * ============================================================================
006 *  Licensed to the public under the agreements of the GNU Lesser General Public
007 *  License, version 3.0 (the "License"). You may obtain a copy of the License at
008 *
009 *       http://www.gnu.org/licenses/lgpl.html
010 *
011 *  Unless required by applicable law or agreed to in writing, software
012 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
013 *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
014 *  License for the specific language governing permissions and limitations
015 *  under the License.
016 */
017
018package org.tquadrat.foundation.exception;
019
020import static org.apiguardian.api.API.Status.STABLE;
021import static org.tquadrat.foundation.lang.Objects.requireNonNullArgument;
022
023import java.io.Serial;
024
025import org.apiguardian.api.API;
026import org.tquadrat.foundation.annotation.ClassVersion;
027
028/**
029 *  <p>{@summary A generic wrapper for checked exceptions.}</p>
030 *  <p>Use this wrapper to emit a checked exception as a
031 *  {@link RuntimeException}.</p>
032 *
033 *  @extauthor Thomas Thrien - thomas.thrien@tquadrat.org
034 *  @version $Id: CheckedExceptionWrapper.java 1055 2023-05-01 14:45:07Z tquadrat $
035 *  @since 0.2.3
036 *
037 *  @UMLGraph.link
038 */
039@SuppressWarnings( "ExceptionClassNameDoesntEndWithException" )
040@ClassVersion( sourceVersion = "$Id: CheckedExceptionWrapper.java 1055 2023-05-01 14:45:07Z tquadrat $" )
041@API( status = STABLE, since = "0.2.3" )
042public sealed class CheckedExceptionWrapper extends RuntimeException
043    permits LambdaContainerException
044{
045        /*------------------------*\
046    ====** Static Initialisations **===========================================
047        \*------------------------*/
048    /**
049     *  The serial version UID for objects of this class: {@value}.
050     *
051     *  @hidden
052     */
053    @Serial
054    private static final long serialVersionUID = 1L;
055
056        /*--------------*\
057    ====** Constructors **=====================================================
058        \*--------------*/
059    /**
060     *  Creates a new {@code CheckedExceptionWrapper} instance for the given
061     *  exception.
062     *
063     *  @param  e   The exception to wrap; <i>cannot</i> be {@code null}.
064     */
065    public CheckedExceptionWrapper( final Exception e )
066    {
067        super( requireNonNullArgument( e, "e" ) );
068    }   //  CheckedExceptionWrapper()
069}
070//  class CheckedExceptionWrapper
071
072/*
073 *  End of File
074 */