Package io.fluentlenium.core.components
Class LazyComponentList<T>
java.lang.Object
io.fluentlenium.core.domain.ListImpl<T>
io.fluentlenium.core.components.LazyComponentList<T>
- Type Parameters:
T
- type of component.
- All Implemented Interfaces:
Iterable<T>
,Collection<T>
,List<T>
,LazyComponents<T>
,WrapsElements
public class LazyComponentList<T>
extends ListImpl<T>
implements List<T>, WrapsElements, LazyComponents<T>
A list of component that lazy initialize from it's related list of elements.
-
Constructor Summary
ConstructorsConstructorDescriptionLazyComponentList
(ComponentInstantiator instantiator, Class<T> componentClass, List<org.openqa.selenium.WebElement> elements) Creates a new lazy component list. -
Method Summary
Modifier and TypeMethodDescriptionboolean
addLazyComponentsListener
(LazyComponentsListener<T> listener) Add a lazy components initialization listener.protected void
fireLazyComponentsInitialized
(Map<org.openqa.selenium.WebElement, T> componentMap) First lazy components initialized event.getList()
List<org.openqa.selenium.WebElement>
Get the wrapped elementsboolean
isLazy()
Get the lazyness of this object.boolean
Check if the underlying lazy components are initialized.boolean
removeLazyComponentsListener
(LazyComponentsListener<T> listener) Remove an existing lazy components initialization listener.toString()
Transform the actual list into components.Methods inherited from class io.fluentlenium.core.domain.ListImpl
add, add, addAll, addAll, clear, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
Constructor Details
-
LazyComponentList
public LazyComponentList(ComponentInstantiator instantiator, Class<T> componentClass, List<org.openqa.selenium.WebElement> elements) Creates a new lazy component list.- Parameters:
instantiator
- component instantiatorcomponentClass
- component classelements
- underlying element list
-
-
Method Details
-
getList
-
transformList
Transform the actual list into components.- Returns:
- transformed list
-
fireLazyComponentsInitialized
First lazy components initialized event.- Parameters:
componentMap
- components
-
addLazyComponentsListener
Description copied from interface:LazyComponents
Add a lazy components initialization listener.- Specified by:
addLazyComponentsListener
in interfaceLazyComponents<T>
- Parameters:
listener
- lazy components listener- Returns:
- true if the listener was added, false otherwise
-
removeLazyComponentsListener
Description copied from interface:LazyComponents
Remove an existing lazy components initialization listener.- Specified by:
removeLazyComponentsListener
in interfaceLazyComponents<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 interfaceLazyComponents<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 interfaceLazyComponents<T>
- Returns:
- true if lazy components are initialized, false otherwise.
-
getWrappedElements
Description copied from interface:WrapsElements
Get the wrapped elements- Specified by:
getWrappedElements
in interfaceWrapsElements
- Returns:
- wrapped elements
-
toString
-