Class LazyComponentList<T>

  • Type Parameters:
    T - type of component.
    All Implemented Interfaces:
    java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>, LazyComponents<T>, WrapsElements

    public class LazyComponentList<T>
    extends ListImpl<T>
    implements java.util.List<T>, WrapsElements, LazyComponents<T>
    A list of component that lazy initialize from it's related list of elements.
    • Constructor Detail

      • LazyComponentList

        public LazyComponentList​(ComponentInstantiator instantiator,
                                 java.lang.Class<T> componentClass,
                                 java.util.List<org.openqa.selenium.WebElement> elements)
        Creates a new lazy component list.
        Parameters:
        instantiator - component instantiator
        componentClass - component class
        elements - underlying element list
    • Method Detail

      • getList

        public java.util.List<T> getList()
        Specified by:
        getList in class ListImpl<T>
      • transformList

        protected java.util.List<T> transformList()
        Transform the actual list into components.
        Returns:
        transformed list
      • fireLazyComponentsInitialized

        protected void fireLazyComponentsInitialized​(java.util.Map<org.openqa.selenium.WebElement,​T> componentMap)
        First lazy components initialized event.
        Parameters:
        componentMap - components
      • addLazyComponentsListener

        public boolean addLazyComponentsListener​(LazyComponentsListener<T> listener)
        Description copied from interface: LazyComponents
        Add a lazy components initialization listener.
        Specified by:
        addLazyComponentsListener in interface LazyComponents<T>
        Parameters:
        listener - lazy components listener
        Returns:
        true if the listener was added, false otherwise
      • removeLazyComponentsListener

        public boolean removeLazyComponentsListener​(LazyComponentsListener<T> listener)
        Description copied from interface: LazyComponents
        Remove an existing lazy components initialization listener.
        Specified by:
        removeLazyComponentsListener in interface LazyComponents<T>
        Parameters:
        listener - lazy components listener
        Returns:
        true if the listener was added, false otherwise
      • isLazy

        public boolean isLazy()
        Description copied from interface: LazyComponents
        Get the lazyness of this object.
        Specified by:
        isLazy in interface LazyComponents<T>
        Returns:
        true if it's lazy, false otherwise.
      • isLazyInitialized

        public boolean isLazyInitialized()
        Description copied from interface: LazyComponents
        Check if the underlying lazy components are initialized.
        Specified by:
        isLazyInitialized in interface LazyComponents<T>
        Returns:
        true if lazy components are initialized, false otherwise.
      • getWrappedElements

        public java.util.List<org.openqa.selenium.WebElement> getWrappedElements()
        Description copied from interface: WrapsElements
        Get the wrapped elements
        Specified by:
        getWrappedElements in interface WrapsElements
        Returns:
        wrapped elements
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object