public class ReuseIfModelsEqualStrategy extends Object implements IItemReuseStrategy
Notice that the model and not the model object needs to implement the
Object.equals(Object) and Object.hashCode() methods. Most of the time it is a good idea to
forward the calls to the object, however if a detachable model is used it is often enough to
compare an identifier for the object the models are pointing to ( this saves the model from loading the
object).
| Constructor and Description |
|---|
ReuseIfModelsEqualStrategy() |
| Modifier and Type | Method and Description |
|---|---|
static IItemReuseStrategy |
getInstance() |
<T> Iterator<Item<T>> |
getItems(IItemFactory<T> factory,
Iterator<IModel<T>> newModels,
Iterator<Item<T>> existingItems)
Returns an iterator over items that will be added to the view.
|
public static IItemReuseStrategy getInstance()
public <T> Iterator<Item<T>> getItems(IItemFactory<T> factory, Iterator<IModel<T>> newModels, Iterator<Item<T>> existingItems)
IItemReuseStrategygetItems in interface IItemReuseStrategyT - type of Itemfactory - implementation of IItemFactorynewModels - iterator over models for itemsexistingItems - iterator over child itemsIItemReuseStrategy.getItems(org.apache.wicket.markup.repeater.IItemFactory,
java.util.Iterator, java.util.Iterator)Copyright © 2006–2014 Apache Software Foundation. All rights reserved.