001/*
002 * ============================================================================
003 *  Copyright © 2002-2026 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 *  @author Thomas Thrien - thomas.thrien@tquadrat.org
034 *  @version $Id: CheckedExceptionWrapper.java 1293 2026-10-16 13:12:15Z tquadrat $
035 *  @since 0.2.3
036 *
037 *  @UMLGraph.link
038 */
039@SuppressWarnings( "ExceptionClassNameDoesntEndWithException" )
040@ClassVersion( sourceVersion = "$Id: CheckedExceptionWrapper.java 1293 2026-10-16 13:12:15Z 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     *  <p>{@summary Creates a new {@class} instance for the given exception.}</p>
061     *
062     *  @param  e   The exception to wrap; <i>cannot</i> be {@null}.
063     */
064    public CheckedExceptionWrapper( final Exception e )
065    {
066        super( requireNonNullArgument( e, "e" ) );
067    }   //  CheckedExceptionWrapper()
068}
069//  class CheckedExceptionWrapper
070
071/*
072 *  End of File
073 */