Class LazyCustomerDataModel

java.lang.Object
jakarta.faces.model.DataModel<Customer>
org.primefaces.model.LazyDataModel<Customer>
org.primefaces.showcase.view.data.datatable.LazyCustomerDataModel
All Implemented Interfaces:
Serializable, Iterable<Customer>, org.primefaces.model.SelectableDataModel<Customer>

public class LazyCustomerDataModel extends org.primefaces.model.LazyDataModel<Customer>
Dummy implementation of LazyDataModel that uses a list to mimic a real datasource like a database.
See Also:
  • Field Summary

    Fields inherited from class org.primefaces.model.LazyDataModel

    rowKeyConverter
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    count(Map<String,org.primefaces.model.FilterMeta> filterBy)
     
     
    getRowKey(Customer customer)
     
    load(int offset, int pageSize, Map<String,org.primefaces.model.SortMeta> sortBy, Map<String,org.primefaces.model.FilterMeta> filterBy)
     

    Methods inherited from class org.primefaces.model.LazyDataModel

    getMessage, getPageSize, getRowCount, getRowData, getRowIndex, getRowKeyFromConverter, getWrappedData, isRowAvailable, iterator, iterator, loadOne, recalculateFirst, setPageSize, setRowCount, setRowIndex, setWrappedData

    Methods inherited from class jakarta.faces.model.DataModel

    addDataModelListener, getDataModelListeners, removeDataModelListener

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator
  • Constructor Details

    • LazyCustomerDataModel

      public LazyCustomerDataModel(List<Customer> datasource)
  • Method Details

    • getRowData

      public Customer getRowData(String rowKey)
      Specified by:
      getRowData in interface org.primefaces.model.SelectableDataModel<Customer>
      Overrides:
      getRowData in class org.primefaces.model.LazyDataModel<Customer>
    • getRowKey

      public String getRowKey(Customer customer)
      Specified by:
      getRowKey in interface org.primefaces.model.SelectableDataModel<Customer>
      Overrides:
      getRowKey in class org.primefaces.model.LazyDataModel<Customer>
    • count

      public int count(Map<String,org.primefaces.model.FilterMeta> filterBy)
      Specified by:
      count in class org.primefaces.model.LazyDataModel<Customer>
    • load

      public List<Customer> load(int offset, int pageSize, Map<String,org.primefaces.model.SortMeta> sortBy, Map<String,org.primefaces.model.FilterMeta> filterBy)
      Specified by:
      load in class org.primefaces.model.LazyDataModel<Customer>