Interface MapService<C,K,V>

All Superinterfaces:
ListService<C, Map.Entry<K,V>>
All Known Implementing Classes:
MapServiceFromListService, MapServiceTransformItem

public interface MapService<C,K,V> extends ListService<C, Map.Entry<K,V>>
A list service is actually quite similar to JPA's TypedQuery, the main difference is, that we use a Mapinvalid input: '<'K, V> here instead of a List<T> The rationale behind that is to be able to use the keys with further LookupServices I also had in mind retrieving data from JSON documents, where (before json-ld) there was no standard way for a designated ID attribute; so the idea was, that the list service indexes the result by whatever is the key. Actually, I think I did something clever anyway: When we fetch a resources, shape, we map each node to its corresponding graph, so we use exactly this interface So we should separate ListService yielding a (paginator of) Map from one that yields a List.
  • Method Details

    • createPaginator

      MapPaginator<K,V> createPaginator(C concept)
      Specified by:
      createPaginator in interface ListService<C,K>
    • fetchData

      default Map<K,V> fetchData(C concept, com.google.common.collect.Range<Long> range)
    • fetchData

      default Map<K,V> fetchData(C concept)
    • fetchCount

      default io.reactivex.rxjava3.core.Single<com.google.common.collect.Range<Long>> fetchCount(C concept, Long itemLimit, Long rowLimit)
      Select Distinct ?v { { Select ?v { concept } Limit rawLimit } } Limit resLimit
      Parameters:
      concept -
      itemLimit - Limit applied on the set of distinct items (resources) //@param rowLimit Limits the number of rows to scan before applying distinct
      Returns:
    • fetchCount

      default io.reactivex.rxjava3.core.Single<Long> fetchCount()
    • fetchData

      default Map<K,V> fetchData(C concept, Long limit, Long offset)
      The recommended map type to be used as the return value is LinkedHashMap.
      Parameters:
      concept -
      limit -
      offset -
      Returns:
    • transformValues

      default <O> MapService<C,K,O> transformValues(BiFunction<? super K, ? super V, ? extends O> transform)