T
- the type of Component
this finder can search.public abstract class ComponentFinderTemplate<T extends Component> extends Object
Component
finders.Modifier | Constructor and Description |
---|---|
protected |
ComponentFinderTemplate(Class<? extends T> componentType)
Creates a new
ComponentFinderTemplate . |
protected |
ComponentFinderTemplate(GenericTypeMatcher<? extends T> matcher)
Creates a new
ComponentFinderTemplate . |
protected |
ComponentFinderTemplate(String componentName,
Class<? extends T> componentType)
Creates a new
ComponentFinderTemplate . |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
cast(Component c)
Casts the given
Component to the type supported by this finder. |
protected T |
findComponentWith(Robot robot)
Finds the component using either by name or type.
|
abstract AbstractComponentFixture<?,T,?> |
using(Robot robot)
Finds a component by name or type using the given robot.
|
protected ComponentFinderTemplate<T> |
withTimeout(long newTimeout)
Sets the timeout for this finder.
|
protected ComponentFinderTemplate<T> |
withTimeout(long newTimeout,
TimeUnit unit)
Sets the timeout for this finder.
|
protected ComponentFinderTemplate(@Nullable String componentName, @Nonnull Class<? extends T> componentType)
ComponentFinderTemplate
.componentName
- the name of the Component
to find.componentType
- the type of the Component
to find.protected ComponentFinderTemplate(@Nonnull GenericTypeMatcher<? extends T> matcher)
ComponentFinderTemplate
.matcher
- specifies the search criteria to use when looking up a Component
.protected ComponentFinderTemplate(@Nonnull Class<? extends T> componentType)
ComponentFinderTemplate
.componentType
- the type of the Component
to find.protected ComponentFinderTemplate<T> withTimeout(@Nonnegative long newTimeout, @Nonnull TimeUnit unit)
Component
to find should be found within the given time period.newTimeout
- the period of time the search should be performed.unit
- the time unit for timeout
.NullPointerException
- if the time unit is null
.IllegalArgumentException
- if the timeout is a negative number.@Nonnull protected ComponentFinderTemplate<T> withTimeout(@Nonnegative long newTimeout)
Component
to find should be found within the given time period.newTimeout
- the number of milliseconds before stopping the search.IllegalArgumentException
- if the timeout is a negative number.@Nonnull public abstract AbstractComponentFixture<?,T,?> using(@Nonnull Robot robot)
robot
- contains the underlying finding to delegate the search to.WaitTimedOutError
- if a component with the given name or of the given type could
not be found.@Nonnull protected final T findComponentWith(@Nonnull Robot robot)
robot
- contains the underlying finding to delegate the search to.WaitTimedOutError
- if a component with the given name or of the given type could
not be found.Copyright © 2014–2019 AssertJ. All rights reserved.