Skip to content
Permalink
Browse files
Delombok - add ListImpl class in order to remove duplicates from two …
…classes
  • Loading branch information
slawekradzyminski committed Dec 28, 2018
1 parent e1c8d59 commit 5296f9f4bcb7067d8c3220347d806772b10659da
@@ -165,50 +165,62 @@ public String getCustomProperty(String propertyName) {
.orElse(null);
}

@Override
public void setConfigurationFactory(Class<? extends ConfigurationFactory> configurationFactory) {
getWritableConfiguration().setConfigurationFactory(configurationFactory);
}

@Override
public void setDeleteCookies(Boolean deleteCookies) {
getWritableConfiguration().setDeleteCookies(deleteCookies);
}

@Override
public void setCustomProperty(String key, String value) {
getWritableConfiguration().setCustomProperty(key, value);
}

@Override
public void setBaseUrl(String baseUrl) {
getWritableConfiguration().setBaseUrl(baseUrl);
}

@Override
public void setWebDriver(String webDriver) {
getWritableConfiguration().setWebDriver(webDriver);
}

@Override
public void setPageLoadTimeout(Long pageLoadTimeout) {
getWritableConfiguration().setPageLoadTimeout(pageLoadTimeout);
}

@Override
public void setHtmlDumpMode(TriggerMode htmlDumpMode) {
getWritableConfiguration().setHtmlDumpMode(htmlDumpMode);
}

@Override
public void setScreenshotPath(String screenshotPath) {
getWritableConfiguration().setScreenshotPath(screenshotPath);
}

@Override
public void setBrowserTimeoutRetries(Integer retriesNumber) {
getWritableConfiguration().setBrowserTimeoutRetries(retriesNumber);
}

@Override
public void setRemoteUrl(String remoteUrl) {
getWritableConfiguration().setRemoteUrl(remoteUrl);
}

@Override
public void setImplicitlyWait(Long implicitlyWait) {
getWritableConfiguration().setImplicitlyWait(implicitlyWait);
}

@Override
public void setDriverLifecycle(DriverLifecycle driverLifecycle) {
getWritableConfiguration().setDriverLifecycle(driverLifecycle);
}
@@ -217,30 +229,37 @@ public void setAwaitPollingEvery(Long awaitPollingEvery) {
getWritableConfiguration().setAwaitPollingEvery(awaitPollingEvery);
}

@Override
public void setCapabilities(Capabilities capabilities) {
getWritableConfiguration().setCapabilities(capabilities);
}

@Override
public void setScreenshotMode(TriggerMode screenshotMode) {
getWritableConfiguration().setScreenshotMode(screenshotMode);
}

@Override
public void setHtmlDumpPath(String htmlDumpPath) {
getWritableConfiguration().setHtmlDumpPath(htmlDumpPath);
}

@Override
public void setAwaitAtMost(Long awaitAtMost) {
getWritableConfiguration().setAwaitAtMost(awaitAtMost);
}

@Override
public void setBrowserTimeout(Long timeout) {
getWritableConfiguration().setBrowserTimeout(timeout);
}

@Override
public void setScriptTimeout(Long scriptTimeout) {
getWritableConfiguration().setScriptTimeout(scriptTimeout);
}

@Override
public void setEventsEnabled(Boolean eventsEnabled) {
getWritableConfiguration().setEventsEnabled(eventsEnabled);
}
@@ -1,30 +1,20 @@
package org.fluentlenium.core.components;

import org.fluentlenium.core.domain.WrapsElements;
import org.openqa.selenium.WebElement;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Comparator;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Spliterator;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;
import java.util.function.IntFunction;
import java.util.function.Predicate;
import java.util.function.UnaryOperator;
import java.util.stream.Stream;
import org.fluentlenium.core.domain.ListImpl;
import org.fluentlenium.core.domain.WrapsElements;
import org.openqa.selenium.WebElement;

/**
* A list of component that lazy initialize from it's related list of elements.
*
* @param <T> type of component.
*/
public class LazyComponentList<T> implements List<T>, WrapsElements, LazyComponents<T> {
public class LazyComponentList<T> extends ListImpl<T> implements List<T>, WrapsElements, LazyComponents<T> {
private final ComponentInstantiator instantiator;
private final Class<T> componentClass;

@@ -120,127 +110,4 @@ public String toString() {
return isLazyInitialized() ? getList().toString() : elements.toString();
}

public void clear() {
getList().clear();
}

public void forEach(Consumer<? super T> action) {
getList().forEach(action);
}

public <T> T[] toArray(IntFunction<T[]> generator) {
return getList().toArray(generator);
}

public boolean isEmpty() {
return getList().isEmpty();
}

public boolean removeIf(Predicate<? super T> filter) {
return getList().removeIf(filter);
}

public Spliterator<T> spliterator() {
return getList().spliterator();
}

public T set(int index, T element) {
return getList().set(index, element);
}

public boolean containsAll(Collection<?> c) {
return getList().containsAll(c);
}

public List<T> subList(int fromIndex, int toIndex) {
return getList().subList(fromIndex, toIndex);
}

public boolean add(T e) {
return getList().add(e);
}

public boolean remove(Object o) {
return getList().remove(o);
}

public int size() {
return getList().size();
}

public ListIterator<T> listIterator() {
return getList().listIterator();
}

public boolean contains(Object o) {
return getList().contains(o);
}

public Object[] toArray() {
return getList().toArray();
}

public void sort(Comparator<? super T> c) {
getList().sort(c);
}

public boolean retainAll(Collection<?> c) {
return getList().retainAll(c);
}

public int lastIndexOf(Object o) {
return getList().lastIndexOf(o);
}

public <T> T[] toArray(T[] a) {
return getList().toArray(a);
}

public boolean removeAll(Collection<?> c) {
return getList().removeAll(c);
}

public T remove(int index) {
return getList().remove(index);
}

public Stream<T> parallelStream() {
return getList().parallelStream();
}

public boolean addAll(Collection<? extends T> c) {
return getList().addAll(c);
}

public int indexOf(Object o) {
return getList().indexOf(o);
}

public void add(int index, T element) {
getList().add(index, element);
}

public T get(int index) {
return getList().get(index);
}

public ListIterator<T> listIterator(int index) {
return getList().listIterator(index);
}

public boolean addAll(int index, Collection<? extends T> c) {
return getList().addAll(index, c);
}

public Stream<T> stream() {
return getList().stream();
}

public Iterator<T> iterator() {
return getList().iterator();
}

public void replaceAll(UnaryOperator<T> operator) {
getList().replaceAll(operator);
}
}

0 comments on commit 5296f9f

Please sign in to comment.