Type Parameters:
T - The type of the data this adapter will receive.
Q - The type of the query this adapter will receive.
VB - The type of the dynamic recycler view binder.
All Implemented Interfaces:
Filterable

public abstract class SimpleQueryBinderAdapter<T,Q,VB extends DynamicRecyclerViewBinder<?>> extends SimpleDataBinderAdapter<T,VB> implements Filterable
A SimpleDataBinderAdapter to handle the generic data with query that can be used with the DynamicQueryBinder.
  • Constructor Details

    • SimpleQueryBinderAdapter

      public SimpleQueryBinderAdapter()
  • Method Details

    • getRawData

      @Nullable public T getRawData()
      Get the raw data used by this binder adapter.
      Returns:
      The raw data used by this binder adapter.
    • isRawData

      public boolean isRawData()
      Checks whether this adapter has raw data.
      Returns:
      true if this adapter has raw data.
    • setData

      public void setData(@Nullable T data, @Nullable Q query, boolean filtered)
      Set the data and query for this binder adapter.
      Parameters:
      data - The data to be set.
      query - The query to be set.
      filtered - true if the filtered data.
    • setData

      public void setData(@Nullable T data, @Nullable Q query)
      Set the data and query for this binder adapter.
      Parameters:
      data - The data to be set.
      query - The query to be set.
      See Also:
    • setData

      public void setData(@Nullable T data)
      Description copied from class: SimpleDataBinderAdapter
      Set the data for this binder adapter.
      Overrides:
      setData in class SimpleDataBinderAdapter<T,VB extends DynamicRecyclerViewBinder<?>>
      Parameters:
      data - The data to be set.
    • setData

      public void setData(@Nullable T data, int position)
      Description copied from class: SimpleDataBinderAdapter
      Set the data for this binder adapter.
      Overrides:
      setData in class SimpleDataBinderAdapter<T,VB extends DynamicRecyclerViewBinder<?>>
      Parameters:
      data - The data to be set.
      position - The binder position to be notified.
    • getQuery

      @Nullable public Q getQuery()
      Get the query used by this binder adapter.
      Returns:
      The query used by this binder adapter.
    • setQuery

      public void setQuery(@Nullable Q query)
      Set the query for this binder adapter.
      Parameters:
      query - The query to be set.
    • onQuery

      @NonNull protected abstract Q onQuery(@NonNull CharSequence constraint)
      Ths method will be called on building the query for the filter.
      Parameters:
      constraint - The constraint returned by the filter.
      Returns:
      The query according to the constraint returned by the filter.
    • onFilter

      @Nullable protected abstract T onFilter(@Nullable T data, @NonNull Q query)
      Ths method will be called on filtering the data.
      Parameters:
      data - The data to be filtered.
      query - The query returned by the filter.
      Returns:
      The filtered data according to the supplied query,
    • onPublishResults

      protected void onPublishResults(@Nullable T data, @NonNull Q query)
      Ths method will be called on publishing the results.
      Parameters:
      data - The data returned by the filter.
      query - The query returned by the filter.
    • getFilter

      public Filter getFilter()
      Specified by:
      getFilter in interface Filterable