001/*
002 *    GeoAPI - Java interfaces for OGC/ISO standards
003 *    Copyright © 2015-2023 Open Geospatial Consortium, Inc.
004 *    http://www.geoapi.org
005 *
006 *    Licensed under the Apache License, Version 2.0 (the "License");
007 *    you may not use this file except in compliance with the License.
008 *    You may obtain a copy of the License at
009 *
010 *        http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *    Unless required by applicable law or agreed to in writing, software
013 *    distributed under the License is distributed on an "AS IS" BASIS,
014 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 *    See the License for the specific language governing permissions and
016 *    limitations under the License.
017 */
018package org.opengis.feature;
019
020
021/**
022 * Thrown when {@link Attribute#getValue()} or {@link FeatureAssociation#getValue()} is invoked
023 * on a property containing more than one value.
024 *
025 * <p>Callers can avoid this exception by invoking the <code>getValue<u>s</u>()</code> method instead
026 * than {@code getValue()}.</p>
027 *
028 * @author  Martin Desruisseaux (Geomatys)
029 * @version 3.1
030 * @since   3.1
031 */
032public class MultiValuedPropertyException extends IllegalStateException {
033    /**
034     * Serial number for inter-operability with different versions.
035     */
036    private static final long serialVersionUID = 2436457345406039415L;
037
038    /**
039     * Creates an exception with no message.
040     */
041    public MultiValuedPropertyException() {
042        super();
043    }
044
045    /**
046     * Creates an exception with the specified message.
047     *
048     * @param message  the detail message, saved for later retrieval by the {@link #getMessage()} method.
049     */
050    public MultiValuedPropertyException(final String message) {
051        super(message);
052    }
053
054    /**
055     * Creates an exception with the specified message and cause.
056     *
057     * @param message  the detail message, saved for later retrieval by the {@link #getMessage()} method.
058     * @param cause    the cause, saved for later retrieval by the {@link #getCause()} method.
059     */
060    public MultiValuedPropertyException(final String message, final Throwable cause) {
061        super(message, cause);
062    }
063}