com.hazelcast.util

## Class ConcurrentReferenceHashMap.WriteThroughEntry

- java.lang.Object
- - com.hazelcast.util.ConcurrentReferenceHashMap.SimpleEntry<K,V>
  - - com.hazelcast.util.ConcurrentReferenceHashMap.WriteThroughEntry

- All Implemented Interfaces:
    Serializable, Map.Entry<K,V>
  Enclosing class:
    ConcurrentReferenceHashMap<K,V>

      protected class ConcurrentReferenceHashMap.WriteThroughEntry
      extends ConcurrentReferenceHashMap.SimpleEntry<K,V>

  Custom Entry class used by EntryIterator.next(), that relays setValue changes to the underlying map.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class com.hazelcast.util.ConcurrentReferenceHashMap.SimpleEntry

      `key, value`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `WriteThroughEntry(K k, V v)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `V` | `setValue(V value)` Set our entry's value and writes it through to the map.

    - ### Methods inherited from class com.hazelcast.util.ConcurrentReferenceHashMap.SimpleEntry

      `equals, getKey, getValue, hashCode, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Map.Entry

      `comparingByKey, comparingByKey, comparingByValue, comparingByValue`

- - ### Constructor Detail

    - #### WriteThroughEntry

          protected WriteThroughEntry(K k,
                                      V v)

  - ### Method Detail

    - #### setValue

          public V setValue(V value)

      Set our entry's value and writes it through to the map. The value to return is somewhat arbitrary: since a WriteThroughEntry does not necessarily track asynchronous changes, the most recent "previous" value could be different from what we return (or could even have been removed in which case the put will re-establish). We do not and cannot guarantee more.
      Specified by:
        `setValue` in interface `Map.Entry<K,V>`
      Overrides:
        `setValue` in class `ConcurrentReferenceHashMap.SimpleEntry<K,V>`

Copyright © 2019. All rights reserved.