Class EmptyEntityList
java.lang.Object
ch.tocco.nice2.persist.core.api.entity.AbstractEntityList
ch.tocco.nice2.persist.core.api.util.EmptyEntityList
- All Implemented Interfaces:
- EntityList,- Iterable<Entity>
An EntityList impl that contains no entries.
- 
Nested Class SummaryNested classes/interfaces inherited from class ch.tocco.nice2.persist.core.api.entity.AbstractEntityListAbstractEntityList.SimpleIteratorNested classes/interfaces inherited from interface ch.tocco.nice2.persist.core.api.entity.EntityListEntityList.Filter
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionget(int index, boolean eager) Get the entity at the specified index.getKey(int index) Returns the PrimaryKey at the specified position.getKeys()Read in subclasses if this array can contain null values or not.Get the entity manager.getModel()Get the model of the entity type contained in this list.intGet the number of pages in this list.intGet the current page size.intindexOf(PrimaryKey key) Get the index within the list of the entity with the specified key.voidsetPageSize(int pageSize) Set the page size.intsize()Get the number of entities this list contains.unwrap()Unwrap to the underlying entity list.Methods inherited from class ch.tocco.nice2.persist.core.api.entity.AbstractEntityListcontains, expect, expectAtLeast, expectAtMost, get, get, get, isEmpty, iterator, toList, toListMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.tocco.nice2.persist.core.api.entity.EntityListdoWithSingleResult, doWithSingleResultOr, expectAtMostOrThrow, expectOr, expectOrThrow, getFirstEntity, getOnlyResult, getOptionalOnlyResult, getOptionalOnlyResult, requireFirstEntity, spliterator, stream
- 
Constructor Details- 
EmptyEntityList
 
- 
- 
Method Details- 
sizepublic int size()Description copied from interface:EntityListGet the number of entities this list contains.- Returns:
- The number of entities.
 
- 
getKeysDescription copied from interface:EntityListRead in subclasses if this array can contain null values or not.- Returns:
- A defensive copy of the array. The size matches the EntityList.size()method.
 
- 
getDescription copied from interface:EntityListGet the entity at the specified index.- Parameters:
- index- The index.
- eager-- true, if a page should be eagerly loaded, if the entity's state is- hollow, false otherwise.
- Returns:
- The entity at the specified index potentially in unusable state, ornull.
- Throws:
- PersistException
 
- 
getKeyDescription copied from interface:EntityListReturns the PrimaryKey at the specified position.
- 
indexOfDescription copied from interface:EntityListGet the index within the list of the entity with the specified key.- Parameters:
- key- The primary key.
- Returns:
- The index or -1, if there's no such entity in the list.
 
- 
getModelDescription copied from interface:EntityListGet the model of the entity type contained in this list.- Returns:
- The model of the entity type contained in this list.
 
- 
getManagerDescription copied from interface:EntityListGet the entity manager.- Returns:
- The entity manager.
 
- 
unwrapDescription copied from interface:EntityListUnwrap to the underlying entity list. Wrappers of entity lists should delegate this to the list they're wrapping, implementations returnthis. It may be that they cannot, and then return themselves (MultiEntityList).- Returns:
- The underlying entity list implementation.
 
- 
setPageSizepublic void setPageSize(int pageSize) Description copied from interface:EntityListSet the page size. The page size determines how many objects will be loaded, once ahollowentity has been accessed.- Parameters:
- pageSize- The new page size.
 
- 
getPageSizepublic int getPageSize()Description copied from interface:EntityListGet the current page size.- Returns:
- The current page size.
 
- 
getPageCountpublic int getPageCount()Description copied from interface:EntityListGet the number of pages in this list.- Returns:
- The number of pages in this list
         (size/pageSize + (size%pageSize>0 ? 1 : 0)).
 
 
-