Class SimpleHolder<V>

java.lang.Object
com.oracle.coherence.common.base.SimpleHolder<V>
Type Parameters:
V - the value type
All Implemented Interfaces:
Holder<V>, Serializable
Direct Known Subclasses:
IdentityHolder, SimpleHolder

public class SimpleHolder<V> extends Object implements Holder<V>, Serializable
SimpleHolder is a basic implementation of the Holder interface.

There value is simply held by a non-volatile reference, thus SimpleHolder does not provide any inter-thread visibility guarantees.

Author:
mf 2010.12.02
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected V
    The held value.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a SimpleHolder with no value.
    SimpleHolder(V value)
    Construct a SimpleHolder with an initial value.
  • Method Summary

    Modifier and Type
    Method
    Description
    get()
    Return the held object.
    void
    set(V value)
    Specify the held object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • m_value

      protected V m_value
      The held value.
  • Constructor Details

    • SimpleHolder

      public SimpleHolder()
      Construct a SimpleHolder with no value.
    • SimpleHolder

      public SimpleHolder(V value)
      Construct a SimpleHolder with an initial value.
      Parameters:
      value - the initial value
  • Method Details

    • set

      public void set(V value)
      Specify the held object.
      Specified by:
      set in interface Holder<V>
      Parameters:
      value - the object to hold
    • get

      public V get()
      Return the held object.
      Specified by:
      get in interface Holder<V>
      Returns:
      the held object