SerializedCacheValue (Apache Geode 1.9.0)
Date: 2019-04-19

org.apache.geode.cache

## Interface SerializedCacheValue<V>

-     public interface SerializedCacheValue<V>

  Class `SerializedCacheValue` represents a serialized cache value. Instances of this class obtained from a region can be put into another region without a copy of this value being made. The two region entries will both have a reference to the same value.

  If this value originated from a region stored off heap then this object can only be used as long as notification method that obtained it has not returned. For example if your implementation of `CacheListener.afterUpdate(EntryEvent)` obtains one by calling `EntryEvent.getSerializedOldValue()` then the SerializedCacheValue returned is only valid until your afterUpdate method returns. It is not safe to store instances of this class and use them later when using off heap storage. Attempts to access off-heap data from this event after it has expired will result in an IllegalStateException.

  Since:
    GemFire 5.5

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `V` | `getDeserializedValue()` Returns the deserialized object for this cache value.
    `byte[]` | `getSerializedValue()` Returns the raw byte[] that represents this cache value.

- - ### Method Detail

    - #### getSerializedValue

          byte[] getSerializedValue()

      Returns the raw byte[] that represents this cache value.
      Returns:
        the raw byte[] that represents this cache value
      Throws:
        `IllegalStateException` - if off-heap and called after the method that was passed the EntryEvent that this serialize value was obtained from returns and this value does not already have the serialized value.

    - #### getDeserializedValue

          V getDeserializedValue()

      Returns the deserialized object for this cache value.
      Returns:
        the deserialized object for this cache value
      Throws:
        `IllegalStateException` - if off-heap and called after the method that was passed the EntryEvent that this serialize value was obtained from returns.