com.hammurapi.store

## Interface Store.Handle<T,PK,S extends Store<T,PK,S>>

- Type Parameters:
    `T` -
  All Known Implementing Classes:
    LocalHandle
  Enclosing interface:
    Store<T,PK,S extends Store<T,PK,S>>

      public static interface Store.Handle<T,PK,S extends Store<T,PK,S>>

  Object handle.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `<V> V` | `extract(Extractor<T,V,S> extractor)` Extracts value from handle's object using given extractor and internal handle's cache.
    `T` | `get()`
    `PK` | `getPrimaryKey()`
    `boolean` | `isValid()`
    `void` | `remove()` Removes object referenced by this handle.
    `void` | `update()` Clears cache and updates indexes.
    `void` | `update(T obj)` Updates object referenced by this handle.

- - ### Method Detail

    - #### update

          void update(T obj)

      Updates object referenced by this handle. Clears cache and updates indexes. The new object shall have the same primary key if the store has primary key extractor.
      Parameters:
        `obj` - New object for the handle (for immutable objects).

    - #### update

          void update()

      Clears cache and updates indexes. Updated object shall have the same primary key if the store has primary key extractor.

    - #### remove

          void remove()

      Removes object referenced by this handle.

    - #### get

          T get()

      Returns:
        Object referenced by this handle.

    - #### getPrimaryKey

          PK getPrimaryKey()

      Returns:
        Primary key if object store is configured with primary key extractor.

    - #### isValid

          boolean isValid()

      Returns:
        True if object referenced by this handle is present in the store.

    - #### extract

          <V> V extract(Extractor<T,V,S> extractor)

      Extracts value from handle's object using given extractor and internal handle's cache.
      Type Parameters:
        `V` - Value type
      Parameters:
        `extractor` - Extractor
      Returns:
        extracted value.