Class ItemLookupResult<T>
- java.lang.Object
-
- de.hybris.platform.odata2services.odata.persistence.lookup.ItemLookupResult<T>
-
public class ItemLookupResult<T> extends java.lang.ObjectResult of looking up items by theItemLookupStrategy. This result is immutable except it does not guarantee immutability of the items returned bygetEntries()method.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ItemLookupResult<T>createFrom(SearchResult<T> result)static <T> ItemLookupResult<T>createFrom(java.util.List<T> entries)static <T> ItemLookupResult<T>createFrom(java.util.List<T> entries, int totalCount)java.util.List<T>getEntries()Retrieves items existing in the platform and matching the request conditions.intgetTotalCount()Retrieves total number of items matching the request conditions and existing in the platform<R> ItemLookupResult<R>map(java.util.function.Function<T,R> f)Transforms this result into a result containing different kind of entries.
-
-
-
Method Detail
-
createFrom
public static <T> ItemLookupResult<T> createFrom(SearchResult<T> result)
-
createFrom
public static <T> ItemLookupResult<T> createFrom(java.util.List<T> entries, int totalCount)
-
createFrom
public static <T> ItemLookupResult<T> createFrom(java.util.List<T> entries)
-
getEntries
public java.util.List<T> getEntries()
Retrieves items existing in the platform and matching the request conditions.- Returns:
- all items matching the
ItemLookupRequestconditions or a subset of all items in case of a paged request. When no items match the conditions, an empty list is returned.
-
getTotalCount
public int getTotalCount()
Retrieves total number of items matching the request conditions and existing in the platform- Returns:
- number of items matching the conditions in the platform. This number may be greater than the number of items returned
by
getEntries()method. Negative number indicates that total number of matching items is not calculated/unknown.
-
map
public <R> ItemLookupResult<R> map(java.util.function.Function<T,R> f)
Transforms this result into a result containing different kind of entries.- Type Parameters:
R- type of the entries in the transformed result- Parameters:
f- a function to be applied to each entry contained in this result- Returns:
- a result containing entries, which were transformed from the original result by applying the specifed function.
-
-