Interface Store<T>

All Known Subinterfaces:
RepositoryRW<T>, ThingRepositoryStore
All Known Implementing Classes:
DatatypeRepositoryBuilder, MemoryRepositoryRW, NamespaceRepositoryBuilder, RepositoryBuilder, ThingMemoryRepositoryROBuilder, ThingMemoryRepositoryRW

public interface Store<T>
Stores "store" (AKA "save" or you can "put") Ts in(to) them.

Stores which are also Provider typically internally actually are, or delegate to, a StoreKV, but their external API is store(T value) instead of StoreKV.store(Object, Object) simply because they internally extract a key from T.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    merge(T item)
    Merge a T into this store.
    store(T item)
    Store a T.
    default Store<T>
    Store multiple Ts; see store(Object).
  • Method Details

    • merge

      void merge(T item)
      Merge a T into this store.

      If this store does not already have this T, then this does the same as store(Object).

      Otherwise, an implementation specific strategy "merges" the existing and new T in the store. Note that this strategy may well be "additive" - meaning you cannot "remove" (or "blank out") properties!

    • store

      @CanIgnoreReturnValue Store<T> store(T item)
      Store a T.

      If this store already has this T, then it's replaced (entirely, not merged).

    • storeAll

      @CanIgnoreReturnValue default Store<T> storeAll(Iterable<T> items)
      Store multiple Ts; see store(Object).