com.hazelcast.spring.cache

## Class HazelcastCache

- java.lang.Object
- - com.hazelcast.spring.cache.HazelcastCache

- All Implemented Interfaces:
    org.springframework.cache.Cache

      public class HazelcastCache
      extends Object
      implements org.springframework.cache.Cache

  Sprint related `Cache` implementation for Hazelcast.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.springframework.cache.Cache

      `org.springframework.cache.Cache.ValueRetrievalException, org.springframework.cache.Cache.ValueWrapper`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HazelcastCache(IMap<Object,Object> map)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `void` | `evict(Object key)`
    `protected Object` | `fromStoreValue(Object value)`
    `org.springframework.cache.Cache.ValueWrapper` | `get(Object key)`
    `<T> T` | `get(Object key, Callable<T> valueLoader)`
    `<T> T` | `get(Object key, Class<T> type)`
    `String` | `getName()`
    `IMap<Object,Object>` | `getNativeCache()`
    `long` | `getReadTimeout()` Return cache retrieval timeout in milliseconds
    `void` | `put(Object key, Object value)`
    `org.springframework.cache.Cache.ValueWrapper` | `putIfAbsent(Object key, Object value)`
    `void` | `setReadTimeout(long readTimeout)` Set cache value retrieval timeout
    `protected Object` | `toStoreValue(Object value)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### HazelcastCache

          public HazelcastCache(IMap<Object,Object> map)

  - ### Method Detail

    - #### getName

          public String getName()

      Specified by:
        `getName` in interface `org.springframework.cache.Cache`

    - #### getNativeCache

          public IMap<Object,Object> getNativeCache()

      Specified by:
        `getNativeCache` in interface `org.springframework.cache.Cache`

    - #### get

          public org.springframework.cache.Cache.ValueWrapper get(Object key)

      Specified by:
        `get` in interface `org.springframework.cache.Cache`

    - #### get

          public <T> T get(Object key,
                           Class<T> type)

      Specified by:
        `get` in interface `org.springframework.cache.Cache`

    - #### get

          public <T> T get(Object key,
                           Callable<T> valueLoader)

      Specified by:
        `get` in interface `org.springframework.cache.Cache`

    - #### put

          public void put(Object key,
                          Object value)

      Specified by:
        `put` in interface `org.springframework.cache.Cache`

    - #### toStoreValue

          protected Object toStoreValue(Object value)

    - #### fromStoreValue

          protected Object fromStoreValue(Object value)

    - #### evict

          public void evict(Object key)

      Specified by:
        `evict` in interface `org.springframework.cache.Cache`

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `org.springframework.cache.Cache`

    - #### putIfAbsent

          public org.springframework.cache.Cache.ValueWrapper putIfAbsent(Object key,
                                                                          Object value)

      Specified by:
        `putIfAbsent` in interface `org.springframework.cache.Cache`

    - #### setReadTimeout

          public void setReadTimeout(long readTimeout)

      Set cache value retrieval timeout
      Parameters:
        `readTimeout` - cache value retrieval timeout in milliseconds. 0 or negative values disable timeout

    - #### getReadTimeout

          public long getReadTimeout()

      Return cache retrieval timeout in milliseconds

Copyright © 2020. All rights reserved.