Package org.fluentlenium.core.components
Class LazyComponentList<T>
- java.lang.Object
-
- org.fluentlenium.core.domain.ListImpl<T>
-
- org.fluentlenium.core.components.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 Summary
Constructors Constructor Description LazyComponentList(ComponentInstantiator instantiator, java.lang.Class<T> componentClass, java.util.List<org.openqa.selenium.WebElement> elements)Creates a new lazy component list.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaddLazyComponentsListener(LazyComponentsListener<T> listener)Add a lazy components initialization listener.protected voidfireLazyComponentsInitialized(java.util.Map<org.openqa.selenium.WebElement,T> componentMap)First lazy components initialized event.java.util.List<T>getList()java.util.List<org.openqa.selenium.WebElement>getWrappedElements()Get the wrapped elementsbooleanisLazy()Get the lazyness of this object.booleanisLazyInitialized()Check if the underlying lazy components are initialized.booleanremoveLazyComponentsListener(LazyComponentsListener<T> listener)Remove an existing lazy components initialization listener.java.lang.StringtoString()protected java.util.List<T>transformList()Transform the actual list into components.-
Methods inherited from class org.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.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 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 instantiatorcomponentClass- component classelements- underlying element list
-
-
Method Detail
-
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:LazyComponentsAdd a lazy components initialization listener.- Specified by:
addLazyComponentsListenerin interfaceLazyComponents<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:LazyComponentsRemove an existing lazy components initialization listener.- Specified by:
removeLazyComponentsListenerin interfaceLazyComponents<T>- Parameters:
listener- lazy components listener- Returns:
- true if the listener was added, false otherwise
-
isLazy
public boolean isLazy()
Description copied from interface:LazyComponentsGet the lazyness of this object.- Specified by:
isLazyin interfaceLazyComponents<T>- Returns:
- true if it's lazy, false otherwise.
-
isLazyInitialized
public boolean isLazyInitialized()
Description copied from interface:LazyComponentsCheck if the underlying lazy components are initialized.- Specified by:
isLazyInitializedin interfaceLazyComponents<T>- Returns:
- true if lazy components are initialized, false otherwise.
-
getWrappedElements
public java.util.List<org.openqa.selenium.WebElement> getWrappedElements()
Description copied from interface:WrapsElementsGet the wrapped elements- Specified by:
getWrappedElementsin interfaceWrapsElements- Returns:
- wrapped elements
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-