001 /*
002 * Created on Nov 24, 2010
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
005 * the License. You may obtain a copy of the License at
006 *
007 * http://www.apache.org/licenses/LICENSE-2.0
008 *
009 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
010 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
011 * specific language governing permissions and limitations under the License.
012 *
013 * Copyright @2010-2011 the original author or authors.
014 */
015 package org.fest.assertions.core;
016
017 import org.fest.assertions.data.Index;
018
019 /**
020 * Assertions methods applicable to indexed groups of objects (e.g. arrays or lists.)
021 *
022 * @author Alex Ruiz
023 * @author Mikhail Mazursky
024 */
025 public interface IndexedObjectEnumerableAssert<T> {
026
027 /**
028 * Verifies that the actual group contains the given object at the given index.
029 * @param value the object to look for.
030 * @param index the index where the object should be stored in the actual group.
031 * @return this assertion object.
032 * @throws AssertionError if the actual group is {@code null} or empty.
033 * @throws NullPointerException if the given {@code Index} is {@code null}.
034 * @throws IndexOutOfBoundsException if the value of the given {@code Index} is equal to or greater than the size of
035 * the actual group.
036 * @throws AssertionError if the actual group does not contain the given object at the given index.
037 */
038 IndexedObjectEnumerableAssert<T> contains(T value, Index index);
039
040 /**
041 * Verifies that the actual group does not contain the given object at the given index.
042 * @param value the object to look for.
043 * @param index the index where the object should be stored in the actual group.
044 * @return this assertion object.
045 * @throws AssertionError if the actual group is {@code null}.
046 * @throws NullPointerException if the given {@code Index} is {@code null}.
047 * @throws AssertionError if the actual group contains the given object at the given index.
048 */
049 IndexedObjectEnumerableAssert<T> doesNotContain(T value, Index index);
050 }