Class FluentLabelImpl<T>

java.lang.Object
io.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 Details

    • FluentLabelImpl

      public FluentLabelImpl (T reference, Supplier<String> defaultLabelSupplier)
      Creates a new fluent label.
      Parameters:
      reference - object reference to chain methods calls.
      defaultLabelSupplier - supplier for default label to display when no label is defined.
  • Method Details

    • 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 interface FluentLabel<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 interface FluentLabelProvider
      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 interface FluentLabel<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 interface FluentLabelProvider
      Returns:
      array of label hints
    • toString

      public String toString()
      Overrides:
      toString in class Object