Package org.assertj.db.navigation
Class Position<E extends AbstractElement<E> & Navigation,N extends AbstractElement<N> & Navigation,D extends DbElement>
java.lang.Object
org.assertj.db.navigation.Position<E,N,D>
- Type Parameters:
E- The class of the actual position (an sub-class ofAbstractElementand ofNavigation).N- The class of the next position where the navigation go (an sub-class ofAbstractElementand ofNavigation).D- The class of the database element on which is the next position (an sub-class ofDbElement).
- Direct Known Subclasses:
PositionWithColumns
public abstract class Position<E extends AbstractElement<E> & Navigation,N extends AbstractElement<N> & Navigation,D extends DbElement>
extends Object
Position during navigation.
- Since:
- 1.1.0
- Author:
- Régis Pouiller
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected DgetDbElement(List<D> dbElementsList, int index) Returns theRowat theindexin parameter.protected abstract StringgetDescription(int index) Returns the description.getInstance(List<D> elementsList) Gets an instance of element of navigation corresponding to the next index.getInstance(List<D> elementsList, int index) Gets an instance of element of navigation corresponding to the index.
-
Constructor Details
-
Position
Constructor.- Parameters:
myself- Actual value.elementClass- Class of the element of navigation (used to make instance).
-
-
Method Details
-
getDbElement
Returns theRowat theindexin parameter.- Parameters:
dbElementsList- List of db elements.index- The index corresponding to theRow.- Returns:
- The
Row. - Throws:
AssertJDBException- If theindexis out of the bounds.
-
getInstance
Gets an instance of element of navigation corresponding to the next index. If this instance is already instanced, the method returns it from the cache.- Parameters:
elementsList- List of elements.- Returns:
- The instance of element of navigation.
-
getInstance
Gets an instance of element of navigation corresponding to the index. If this instance is already instanced, the method returns it from the cache.- Parameters:
elementsList- List of elements.index- Index of the element on which is the instance of element of navigation.- Returns:
- The instance of element of navigation.
-
getDescription
Returns the description.- Parameters:
index- Index of the value.- Returns:
- The description
-