// Path: src/main/java/pl/wavesoftware/eid/api/Eid.java
// public interface Eid extends Serializable {
//     /**
//      * Getter for constant Exception ID
//      *
//      * @return ID of exception
//      */
//     String getId();
// 
//     /**
//      * Get an external reference passed to Exception ID
//      *
//      * @return an external reference, or null if not set
//      */
//     @Nullable
//     String getRef();
// 
//     /**
//      * Do this Exception ID has an external reference number?
//      *
//      * @return true, if has an external reference
//      */
//     boolean hasRef();
// 
//     /**
//      * Gets unique generated string for this instance of Eid
//      *
//      * @return a unique string
//      */
//     String getUnique();
// 
//     /**
//      * Creates a message object from this Eid, with given message template and
//      * template arguments. Message template and arguments will be interpolated
//      * using {@link java.text.MessageFormat#format(String, Object...)} method.
//      *
//      * @param messageTemplate   a message format
//      * @param templateArguments a message format arguments that will be
//      *                          interpolated to format string
//      * @return a message object
//      */
//     EidMessage message(
//         CharSequence messageTemplate,
//         Object... templateArguments
//     );
// }
// 
// Path: src/main/java/pl/wavesoftware/eid/api/EidMessage.java
// public interface EidMessage extends CharSequence, EidContainer {
// 
//     /**
//      * Get a formatted message
//      *
//      * @return a formatted message
//      */
//     CharSequence getFormattedMessage();
// }


import pl.wavesoftware.eid.api.Eid;
import pl.wavesoftware.eid.api.EidMessage;
import javax.annotation.Nullable;
/*
 * Copyright (c) 2015 Wave Software
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package pl.wavesoftware.eid.exceptions;



/**
 * This exception is Eid version of Java's {@link IndexOutOfBoundsException} that
 * holds an {@link Eid} object. It can be used to process it in application
 * central error handler.
 * <p>
 * <strong>Caution!</strong> This class shouldn't be used in any public API or
 * library. It is designed to be used for in-house development of end user
 * applications which will report bugs in standardized error pages or post them
 * to issue tracker.
 *
 * @see IndexOutOfBoundsException
 * @see EidRuntimeException
 * @author <a href="mailto:krzysztof.suszynski@wavesoftware.pl">Krzysztof Suszynski</a>
 * @since 0.1.0
 */
public class EidIndexOutOfBoundsException extends EidRuntimeException {

    private static final long serialVersionUID = -9876432123423451L;

    /**
     * Constructs a new runtime exception with the specified Exception ID as
     * it's detail message, that's {@code new Eid(eid).toString()}.
     * <p>
     * The cause is not initialized, and may subsequently be initialized by
     * a call to {@link #initCause}.
     *
     * @param eid an exception ID as character sequence
     */
    public EidIndexOutOfBoundsException(CharSequence eid) {
        super(eid);
    }

    /**
     * Constructs a new runtime exception with the specified Exception ID and
     * detail message.
     * <p>
     * The cause is not initialized, and may subsequently be initialized by a
     * call to {@link #initCause}.
     *
     * @param eid     an exception ID as character sequence
     * @param message the detail message. The detail message is saved for
     *                later retrieval by the {@link #getMessage()} method.
     */
    public EidIndexOutOfBoundsException(CharSequence eid, String message) {
        super(eid, message);
    }

    /**
     * Constructs a new runtime exception with the specified Eid message.
     * <p>
     * The cause is not initialized, and may subsequently be initialized by a
     * call to {@link #initCause}.
     *
     * @param message the Eid message. The detail message is saved for
     *                later retrieval by the {@link #getMessage()} method.
     */
    public EidIndexOutOfBoundsException(EidMessage message) {
        super(message);
    }

    /**
     * Constructs a new runtime exception with the specified Exception ID,
     * detail message and cause.
     *
     * <p>
     * Note that the detail message associated with <code>cause</code> is
     * <i>not</i> automatically incorporated in this runtime exception's
     * detail message.
     *
     * @param eid     an exception ID as character sequence
     * @param message the detail message (which is saved for later retrieval
     *                by the {@link #getMessage()} method).
     * @param cause   the cause (which is saved for later retrieval by the
     *                {@link #getCause()} method).  (A <tt>null</tt> value is
     *                permitted, and indicates that the cause is nonexistent or
     */
    public EidIndexOutOfBoundsException(
        CharSequence eid, String message, @Nullable Throwable cause
    ) {
        super(eid, message, cause);
    }

    /**
     * Constructs a new runtime exception with the specified Exception ID,
     * detail message and cause.
     *
     * <p>
     * Note that the detail message associated with <code>cause</code> is
     * <i>not</i> automatically incorporated in this runtime exception's
     * detail message.
     *
     * @param message the Eid message (which is saved for later retrieval
     *                by the {@link #getMessage()} method).
     * @param cause   the cause (which is saved for later retrieval by the
     *                {@link #getCause()} method).  (A <tt>null</tt> value is
     *                permitted, and indicates that the cause is nonexistent or
     */
    public EidIndexOutOfBoundsException(
// Path: src/main/java/pl/wavesoftware/eid/api/Eid.java
// public interface Eid extends Serializable {
//     /**
//      * Getter for constant Exception ID
//      *
//      * @return ID of exception
//      */
//     String getId();
// 
//     /**
//      * Get an external reference passed to Exception ID
//      *
//      * @return an external reference, or null if not set
//      */
//     @Nullable
//     String getRef();
// 
//     /**
//      * Do this Exception ID has an external reference number?
//      *
//      * @return true, if has an external reference
//      */
//     boolean hasRef();
// 
//     /**
//      * Gets unique generated string for this instance of Eid
//      *
//      * @return a unique string
//      */
//     String getUnique();
// 
//     /**
//      * Creates a message object from this Eid, with given message template and
//      * template arguments. Message template and arguments will be interpolated
//      * using {@link java.text.MessageFormat#format(String, Object...)} method.
//      *
//      * @param messageTemplate   a message format
//      * @param templateArguments a message format arguments that will be
//      *                          interpolated to format string
//      * @return a message object
//      */
//     EidMessage message(
//         CharSequence messageTemplate,
//         Object... templateArguments
//     );
// }
// 
// Path: src/main/java/pl/wavesoftware/eid/api/EidMessage.java
// public interface EidMessage extends CharSequence, EidContainer {
// 
//     /**
//      * Get a formatted message
//      *
//      * @return a formatted message
//      */
//     CharSequence getFormattedMessage();
// }


// Path: src/main/java/pl/wavesoftware/eid/exceptions/EidIndexOutOfBoundsException.java
import pl.wavesoftware.eid.api.Eid;
import pl.wavesoftware.eid.api.EidMessage;
import javax.annotation.Nullable;

/*
 * Copyright (c) 2015 Wave Software
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package pl.wavesoftware.eid.exceptions;



/**
 * This exception is Eid version of Java's {@link IndexOutOfBoundsException} that
 * holds an {@link Eid} object. It can be used to process it in application
 * central error handler.
 * <p>
 * <strong>Caution!</strong> This class shouldn't be used in any public API or
 * library. It is designed to be used for in-house development of end user
 * applications which will report bugs in standardized error pages or post them
 * to issue tracker.
 *
 * @see IndexOutOfBoundsException
 * @see EidRuntimeException
 * @author <a href="mailto:krzysztof.suszynski@wavesoftware.pl">Krzysztof Suszynski</a>
 * @since 0.1.0
 */
public class EidIndexOutOfBoundsException extends EidRuntimeException {

    private static final long serialVersionUID = -9876432123423451L;

    /**
     * Constructs a new runtime exception with the specified Exception ID as
     * it's detail message, that's {@code new Eid(eid).toString()}.
     * <p>
     * The cause is not initialized, and may subsequently be initialized by
     * a call to {@link #initCause}.
     *
     * @param eid an exception ID as character sequence
     */
    public EidIndexOutOfBoundsException(CharSequence eid) {
        super(eid);
    }

    /**
     * Constructs a new runtime exception with the specified Exception ID and
     * detail message.
     * <p>
     * The cause is not initialized, and may subsequently be initialized by a
     * call to {@link #initCause}.
     *
     * @param eid     an exception ID as character sequence
     * @param message the detail message. The detail message is saved for
     *                later retrieval by the {@link #getMessage()} method.
     */
    public EidIndexOutOfBoundsException(CharSequence eid, String message) {
        super(eid, message);
    }

    /**
     * Constructs a new runtime exception with the specified Eid message.
     * <p>
     * The cause is not initialized, and may subsequently be initialized by a
     * call to {@link #initCause}.
     *
     * @param message the Eid message. The detail message is saved for
     *                later retrieval by the {@link #getMessage()} method.
     */
    public EidIndexOutOfBoundsException(EidMessage message) {
        super(message);
    }

    /**
     * Constructs a new runtime exception with the specified Exception ID,
     * detail message and cause.
     *
     * <p>
     * Note that the detail message associated with <code>cause</code> is
     * <i>not</i> automatically incorporated in this runtime exception's
     * detail message.
     *
     * @param eid     an exception ID as character sequence
     * @param message the detail message (which is saved for later retrieval
     *                by the {@link #getMessage()} method).
     * @param cause   the cause (which is saved for later retrieval by the
     *                {@link #getCause()} method).  (A <tt>null</tt> value is
     *                permitted, and indicates that the cause is nonexistent or
     */
    public EidIndexOutOfBoundsException(
        CharSequence eid, String message, @Nullable Throwable cause
    ) {
        super(eid, message, cause);
    }

    /**
     * Constructs a new runtime exception with the specified Exception ID,
     * detail message and cause.
     *
     * <p>
     * Note that the detail message associated with <code>cause</code> is
     * <i>not</i> automatically incorporated in this runtime exception's
     * detail message.
     *
     * @param message the Eid message (which is saved for later retrieval
     *                by the {@link #getMessage()} method).
     * @param cause   the cause (which is saved for later retrieval by the
     *                {@link #getCause()} method).  (A <tt>null</tt> value is
     *                permitted, and indicates that the cause is nonexistent or
     */
    public EidIndexOutOfBoundsException(
        EidMessage message, @Nullable Throwable cause