Interface Store<ApiType>

Type Parameters:
ApiType - kubernetes api type
All Known Subinterfaces:
Indexer<ApiType>
All Known Implementing Classes:
Cache

public interface Store<ApiType>
Interface for implementations which stores objects.

The code has been copied from the official client and modified: Store

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(ApiType obj)
    Inserts an item into the store.
    void
    Removes an item from the store.
    getByKey(@NonNull String key)
    Returns the request item with specific key.
    Returns a function which creates an object key.
    @NonNull List<ApiType>
    Returns a list of all the items.
    @NonNull List<String>
    Returns a list of keys of all objects that are currently in the store.
    void
    replace(@NonNull List<ApiType> objects)
    Replace the content in the cache completely.
    void
    Sets an item in the store to its updated state.
  • Method Details

    • getKeyFunction

      @NonNull @NonNull Function<ApiType,String> getKeyFunction()
      Returns a function which creates an object key.
      Returns:
      function which creates an object key
    • add

      void add(@NonNull ApiType obj)
      Inserts an item into the store.
      Parameters:
      obj - specific obj
    • update

      void update(@NonNull ApiType obj)
      Sets an item in the store to its updated state.
      Parameters:
      obj - specific obj
    • delete

      void delete(@NonNull ApiType obj)
      Removes an item from the store.
      Parameters:
      obj - specific obj
    • replace

      void replace(@NonNull @NonNull List<ApiType> objects)
      Replace the content in the cache completely.
      Parameters:
      objects - list of kubernetes objects
    • listKeys

      @NonNull @NonNull List<String> listKeys()
      Returns a list of keys of all objects that are currently in the store.
      Returns:
      list of all keys
    • getByKey

      @Nullable ApiType getByKey(@NonNull @NonNull String key)
      Returns the request item with specific key.
      Parameters:
      key - specific key
      Returns:
      the request item
    • list

      @NonNull @NonNull List<ApiType> list()
      Returns a list of all the items.
      Returns:
      list of all the items