001/*
002 * The contents of this file are subject to the terms of the Common Development and
003 * Distribution License (the License). You may not use this file except in compliance with the License.
004 *
005 * You can obtain a copy of the License at legal/CDDLv1.0.txt. See the License for the
006 * specific language governing permission and limitations under the License.
007 *
008 * When distributing Covered Software, include this CDDL Header Notice in each file and include
009 * the License file at legal/CDDLv1.0.txt. If applicable, add the following below the CDDL
010 * Header, with the fields enclosed by brackets [] replaced by your own identifying
011 * information: "Portions copyright [year] [name of copyright owner]".
012 *
013 * Copyright 2015 ForgeRock AS.
014 */
015package org.forgerock.util.promise;
016
017/**
018 * The {@code NeverThrowsException} class is an uninstantiable placeholder
019 * exception which should be used for indicating that a {@link org.forgerock.util.Function} or
020 * {@link org.forgerock.util.AsyncFunction} never throws an exception (i.e. the function cannot
021 * fail).
022 */
023public final class NeverThrowsException extends RuntimeException {
024    /**
025     * Serialization ID.
026     */
027    private static final long serialVersionUID = 2879912363036916597L;
028
029    // Prevent instantiation.
030    private NeverThrowsException() {
031        throw new IllegalStateException();
032    }
033}