Class ObjectWrapper<O>

java.lang.Object
com.bytedesk.call.mrcp4j.util.ObjectWrapper<O>
Type Parameters:
O - type of the object being wrapped

public class ObjectWrapper<O> extends Object
Utility class for wrapping object references. The primary purpose of this class is to allow for null values to be passed to methods that may not accept null values. For example posting a null value to a java.util.concurrent.BlockingQueue.
Author:
Niels Godfredsen <ngodfredsen@users.sourceforge.net>
  • Field Details

    • _obj

      private O _obj
  • Constructor Details

    • ObjectWrapper

      public ObjectWrapper(O obj)
      Constructs an instance that wraps the specified object.
      Parameters:
      obj - object to be wrapped. Null values allowed.
  • Method Details

    • getObject

      public O getObject()
      Gets the object wrapped by this instance.
      Returns:
      the wrapped object or null if this instance wraps a null.