001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
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,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.juneau.marshall;
018
019/**
020 * Subclass of runtime exceptions that take in a message and zero or more arguments.
021 *
022 * <p>
023 * This class extends {@link org.apache.juneau.commons.BasicRuntimeException} in juneau-commons
024 * for backward compatibility.
025 *
026 * @serial exclude
027 */
028@SuppressWarnings({
029   "java:S2176" // Intentional same-named backward-compat re-export of org.apache.juneau.commons.BasicRuntimeException; renaming this public class would break the API.
030})
031public class BasicRuntimeException extends org.apache.juneau.commons.BasicRuntimeException {
032   private static final long serialVersionUID = 1L;
033
034   /**
035    * Constructor.
036    *
037    * @param message The {@link String#format(String, Object...) String.format}-style message (<c>%s</c> placeholders).
038    * @param args Optional {@link String#format(String, Object...) String.format}-style arguments.
039    */
040   public BasicRuntimeException(String message, Object...args) {
041      super(message, args);
042   }
043
044   /**
045    * Constructor.
046    *
047    * @param cause The cause of this exception.  Can be <jk>null</jk> (no cause is set).
048    */
049   public BasicRuntimeException(Throwable cause) {
050      super(cause);
051   }
052
053   /**
054    * Constructor.
055    *
056    * @param cause The cause of this exception.  Can be <jk>null</jk> (no cause is set).
057    * @param message The {@link String#format(String, Object...) String.format}-style message (<c>%s</c> placeholders).
058    * @param args Optional {@link String#format(String, Object...) String.format}-style arguments.
059    */
060   public BasicRuntimeException(Throwable cause, String message, Object...args) {
061      super(cause, message, args);
062   }
063
064   @Override /* Overridden from BasicRuntimeException */
065   public BasicRuntimeException setMessage(String message, Object...args) {
066      super.setMessage(message, args);
067      return this;
068   }
069}