Package org.fluentlenium.core.label
Class FluentLabelImpl<T>
- java.lang.Object
-
- org.fluentlenium.core.label.FluentLabelImpl<T>
-
- Type Parameters:
T
-this
class to chain method calls
- All Implemented Interfaces:
FluentLabel<T>
,FluentLabelProvider
public class FluentLabelImpl<T> extends Object implements FluentLabel<T>, FluentLabelProvider
Apply label and label hints to element.
-
-
Constructor Summary
Constructors Constructor Description FluentLabelImpl(T reference, Supplier<String> defaultLabelSupplier)
Creates a new fluent label.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getLabel()
Get the defined label.String[]
getLabelHints()
Get the defined label hints.String
toString()
T
withLabel(String label)
Apply a label that will be displayed as the representation of this object for error message.T
withLabelHint(String... labelHint)
Add a label hint that will be appended to the representation of this object for error message.
-
-
-
Method Detail
-
withLabel
public T withLabel(String label)
Description copied from interface:FluentLabel
Apply a label that will be displayed as the representation of this object for error message.- Specified by:
withLabel
in interfaceFluentLabel<T>
- Parameters:
label
- label to use- Returns:
- reference to this object to chain calls
-
getLabel
public String getLabel()
Get the defined label.- Specified by:
getLabel
in interfaceFluentLabelProvider
- Returns:
- defined value
-
withLabelHint
public T withLabelHint(String... labelHint)
Description copied from interface:FluentLabel
Add a label hint that will be appended to the representation of this object for error message.- Specified by:
withLabelHint
in interfaceFluentLabel<T>
- Parameters:
labelHint
- label hints to add- Returns:
- reference to this object to chain calls
-
getLabelHints
public String[] getLabelHints()
Get the defined label hints.- Specified by:
getLabelHints
in interfaceFluentLabelProvider
- Returns:
- array of label hints
-
-