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 */
024 public interface IndexedObjectEnumerableAssert {
025
026 /**
027 * Verifies that the actual group contains the given object at the given index.
028 * @param value the object to look for.
029 * @param index the index where the object should be stored in the actual group.
030 * @return this assertion object.
031 * @throws AssertionError if the actual group is {@code null} or empty.
032 * @throws NullPointerException if the given {@code Index} is {@code null}.
033 * @throws IndexOutOfBoundsException if the value of the given {@code Index} is equal to or greater than the size of
034 * the actual group.
035 * @throws AssertionError if the actual group does not contain the given object at the given index.
036 */
037 IndexedObjectEnumerableAssert contains(Object value, Index index);
038
039 /**
040 * Verifies that the actual group does not contain the given object at the given index.
041 * @param value the object to look for.
042 * @param index the index where the object should be stored in the actual group.
043 * @return this assertion object.
044 * @throws AssertionError if the actual group is {@code null}.
045 * @throws NullPointerException if the given {@code Index} is {@code null}.
046 * @throws AssertionError if the actual group contains the given object at the given index.
047 */
048 IndexedObjectEnumerableAssert doesNotContain(Object value, Index index);
049 }