1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements.  See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License.  You may obtain a copy of the License at
7 *
8 *     http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package java.util;
17
18/**
19 * An {@code UnknownFormatConversionException} will be thrown if the format
20 * conversion is unknown.
21 *
22 * @see java.lang.RuntimeException
23 */
24public class UnknownFormatConversionException extends IllegalFormatException {
25    private static final long serialVersionUID = 19060418L;
26
27    private final String s;
28
29    /**
30     * Constructs an {@code UnknownFormatConversionException} with the unknown
31     * format conversion.
32     *
33     * @param s
34     *           the unknown format conversion.
35     */
36    public UnknownFormatConversionException(String s) {
37        if (s == null) {
38            throw new NullPointerException("s == null");
39        }
40        this.s = s;
41    }
42
43    /**
44     * Returns the conversion associated with the exception.
45     *
46     * @return the conversion associated with the exception.
47     */
48    public String getConversion() {
49        return s;
50    }
51
52    @Override
53    public String getMessage() {
54        return "Conversion: " + s;
55    }
56}
57