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 of AbstractElement and of Navigation).
N - The class of the next position where the navigation go (an sub-class of AbstractElement and of Navigation).
D - The class of the database element on which is the next position (an sub-class of DbElement).
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 Details

    • Position

      public Position(E myself, Class<N> elementClass)
      Constructor.
      Parameters:
      myself - Actual value.
      elementClass - Class of the element of navigation (used to make instance).
  • Method Details

    • getDbElement

      protected D getDbElement(List<D> dbElementsList, int index)
      Returns the Row at the index in parameter.
      Parameters:
      dbElementsList - List of db elements.
      index - The index corresponding to the Row.
      Returns:
      The Row.
      Throws:
      AssertJDBException - If the index is out of the bounds.
    • getInstance

      public N getInstance(List<D> elementsList)
      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

      public N getInstance(List<D> elementsList, int index)
      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

      protected abstract String getDescription(int index)
      Returns the description.
      Parameters:
      index - Index of the value.
      Returns:
      The description