Class AbstractSortedEntityList
java.lang.Object
ch.tocco.nice2.persist.core.api.entity.AbstractEntityList
ch.tocco.nice2.persist.core.api.entity.AbstractEntityListWrapper
ch.tocco.nice2.persist.core.api.util.AbstractSortedEntityList
- All Implemented Interfaces:
EntityList
,Iterable<Entity>
- Direct Known Subclasses:
KeySortedEntityList
,ValueSortedEntityList
Base class for EntityList sort wrappers.
-
Nested Class Summary
Nested classes/interfaces inherited from class ch.tocco.nice2.persist.core.api.entity.AbstractEntityList
AbstractEntityList.SimpleIterator
Nested classes/interfaces inherited from interface ch.tocco.nice2.persist.core.api.entity.EntityList
EntityList.Filter
-
Field Summary
Fields inherited from class ch.tocco.nice2.persist.core.api.entity.AbstractEntityListWrapper
entityList
-
Method Summary
Modifier 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.int
indexOf
(PrimaryKey key) Get the index within the list of the entity with the specified key.int
size()
Get the number of entities this list contains.Methods inherited from class ch.tocco.nice2.persist.core.api.entity.AbstractEntityListWrapper
getManager, getModel, getPageCount, getPageSize, setPageSize, unwrap
Methods inherited from class ch.tocco.nice2.persist.core.api.entity.AbstractEntityList
contains, expect, expectAtLeast, expectAtMost, get, get, get, isEmpty, iterator, toList, toList
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.entity.EntityList
doWithSingleResult, doWithSingleResultOr, expectAtMostOrThrow, expectOr, expectOrThrow, getFirstEntity, getOnlyResult, getOptionalOnlyResult, getOptionalOnlyResult, requireFirstEntity, spliterator, stream
-
Field Details
-
keys
-
-
Method Details
-
size
public int size()Description copied from interface:EntityList
Get the number of entities this list contains.- Specified by:
size
in interfaceEntityList
- Overrides:
size
in classAbstractEntityListWrapper
- Returns:
- The number of entities.
-
getKeys
Description copied from interface:EntityList
Read in subclasses if this array can contain null values or not.- Specified by:
getKeys
in interfaceEntityList
- Overrides:
getKeys
in classAbstractEntityListWrapper
- Returns:
- A defensive copy of the array. The size matches the
EntityList.size()
method.
-
get
Description copied from interface:EntityList
Get the entity at the specified index.- Specified by:
get
in interfaceEntityList
- Overrides:
get
in classAbstractEntityListWrapper
- Parameters:
index
- The index.eager
-true
, if a page should be eagerly loaded, if the entity's state ishollow
, false otherwise.- Returns:
- The entity at the specified index potentially in
unusable state
, ornull
. - Throws:
PersistException
IndexOutOfBoundsException
-
getKey
Description copied from interface:EntityList
Returns the PrimaryKey at the specified position.- Specified by:
getKey
in interfaceEntityList
- Overrides:
getKey
in classAbstractEntityListWrapper
-
indexOf
Description copied from interface:EntityList
Get the index within the list of the entity with the specified key.- Specified by:
indexOf
in interfaceEntityList
- Overrides:
indexOf
in classAbstractEntityListWrapper
- Parameters:
key
- The primary key.- Returns:
- The index or -1, if there's no such entity in the list.
-