Class AutoCompleteTextDataBinding<V>

Type Parameters:
V - The type of selectable values
All Implemented Interfaces:
AbstractDataBinding<V>, AbstractSelectObjectDataBinding<V>

public class AutoCompleteTextDataBinding<V> extends AbstractAutoCompleteTextDataBinding<V>
A concrete implementation of AbstractAutoCompleteTextDataBinding that provides functional interfaces for value access, modification, and display formatting.
Author:
Ionov Ivan
See Also:
  • Field Details

    • valueExtractor

      protected Supplier<V> valueExtractor
      The function that provides the current model value. Defaults to a supplier that returns null.
    • handler

      protected Consumer<V> handler
      The function that handles new values when selected. Defaults to a no-op consumer.
    • nameExtractor

      protected Function<V,String> nameExtractor
      The function that formats values for display in the auto-complete dropdown. Defaults to standard String.valueOf() conversion.
  • Constructor Details

    • AutoCompleteTextDataBinding

      public AutoCompleteTextDataBinding()
  • Method Details

    • getValue

      public V getValue()
      Description copied from interface: AbstractDataBinding
      Gets the current value from the binding.
      Returns:
      The current value of type V
    • doAction

      public void doAction(V newNalue)
      Description copied from interface: AbstractDataBinding
      Performs an action when the value changes.
      Parameters:
      newNalue - The new value being set
    • format

      protected String format(V value)
      Description copied from class: AbstractAutoCompleteTextDataBinding
      Formats a value for display in the auto-complete dropdown. Must be implemented by concrete subclasses.
      Specified by:
      format in class AbstractAutoCompleteTextDataBinding<V>
      Parameters:
      value - The value to format
      Returns:
      String representation of the value
    • valueExtractor

      public AutoCompleteTextDataBinding<V> valueExtractor(Supplier<V> valueExtractor)
      Sets the value extractor function that provides the current model value.
      Parameters:
      valueExtractor - The supplier function to get the current value
      Returns:
      this binding instance for method chaining
    • handler

      public AutoCompleteTextDataBinding<V> handler(Consumer<V> handler)
      Sets the handler function that processes new values from auto-complete selection.
      Parameters:
      handler - The consumer function to handle value changes
      Returns:
      this binding instance for method chaining
    • nameExtractor

      public AutoCompleteTextDataBinding<V> nameExtractor(Function<V,String> nameExtractor)
      Sets the name extractor function that formats values for display.
      Parameters:
      nameExtractor - The function to convert values to display strings
      Returns:
      this binding instance for method chaining