Class AbstractKeyValueAdapter

java.lang.Object
org.springframework.data.keyvalue.core.AbstractKeyValueAdapter
All Implemented Interfaces:
DisposableBean, KeyValueAdapter
Direct Known Subclasses:
MapKeyValueAdapter

public abstract class AbstractKeyValueAdapter extends Object implements KeyValueAdapter
Base implementation of KeyValueAdapter holds QueryEngine to delegate find and count execution to.
Author:
Christoph Strobl, Mark Paluch
  • Constructor Details

  • Method Details

    • getQueryEngine

      protected QueryEngine<? extends KeyValueAdapter,?,?> getQueryEngine()
      Get the QueryEngine used.
      Returns:
    • get

      @Nullable public <T> T get(Object id, String keyspace, Class<T> type)
      Description copied from interface: KeyValueAdapter
      Get the object with given id from keyspace.
      Specified by:
      get in interface KeyValueAdapter
      Parameters:
      id - must not be null.
      keyspace - must not be null.
      type - must not be null.
      Returns:
      null in case no matching item exists.
    • delete

      @Nullable public <T> T delete(Object id, String keyspace, Class<T> type)
      Description copied from interface: KeyValueAdapter
      Delete and return the object with given type and id.
      Specified by:
      delete in interface KeyValueAdapter
      Parameters:
      id - must not be null.
      keyspace - must not be null.
      type - must not be null.
      Returns:
      null if object could not be found
    • find

      public <T> Iterable<T> find(KeyValueQuery<?> query, String keyspace, Class<T> type)
      Specified by:
      find in interface KeyValueAdapter
      Parameters:
      query - must not be null.
      keyspace - must not be null.
      type - must not be null.
      Returns:
      empty Collection if no match found.
    • find

      public Collection<?> find(KeyValueQuery<?> query, String keyspace)
      Description copied from interface: KeyValueAdapter
      Find all matching objects within keyspace.
      Specified by:
      find in interface KeyValueAdapter
      Parameters:
      query - must not be null.
      keyspace - must not be null.
      Returns:
      empty Collection if no match found.
    • count

      public long count(KeyValueQuery<?> query, String keyspace)
      Description copied from interface: KeyValueAdapter
      Count all matching objects within keyspace.
      Specified by:
      count in interface KeyValueAdapter
      Parameters:
      query - must not be null.
      keyspace - must not be null.
      Returns: