org.infinispan.schematic.internal

## Class InMemoryDocumentLibrary

- java.lang.Object
- - org.infinispan.schematic.internal.InMemoryDocumentLibrary

- All Implemented Interfaces:
    Serializable, DocumentLibrary

      public class InMemoryDocumentLibrary
      extends Object
      implements DocumentLibrary, Serializable

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InMemoryDocumentLibrary(String name)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Document` | `get(String key)` Get the document with the supplied key.
    `String` | `getName()` Get the name of this library.
    `Document` | `put(String key, Document document)` Store the supplied document at the given key.
    `Document` | `putIfAbsent(String key, Document document)` Store the supplied document at the given key.
    `Document` | `remove(String key)` Remove the existing document at the given key.
    `Document` | `replace(String key, Document document)` Replace the existing document at the given key with the document that is supplied.

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

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

- - ### Constructor Detail

    - #### InMemoryDocumentLibrary

          public InMemoryDocumentLibrary(String name)

  - ### Method Detail

    - #### getName

          public String getName()

      Description copied from interface: `DocumentLibrary`
      Get the name of this library.
      Specified by:
        `getName` in interface `DocumentLibrary`
      Returns:
        the library name; never null

    - #### get

          public Document get(String key)

      Description copied from interface: `DocumentLibrary`
      Get the document with the supplied key.
      Specified by:
        `get` in interface `DocumentLibrary`
      Parameters:
        `key` - the key or identifier for the document
      Returns:
        the document, or null if there was no document with the supplied key

    - #### put

          public Document put(String key,
                     Document document)

      Description copied from interface: `DocumentLibrary`
      Store the supplied document at the given key.
      Specified by:
        `put` in interface `DocumentLibrary`
      Parameters:
        `key` - the key or identifier for the document
        `document` - the document that is to be stored
      Returns:
        the document that was previously stored at this key, or null if there was no document with the supplied key

    - #### putIfAbsent

          public Document putIfAbsent(String key,
                             Document document)

      Description copied from interface: `DocumentLibrary`
      Store the supplied document at the given key.
      Specified by:
        `putIfAbsent` in interface `DocumentLibrary`
      Parameters:
        `key` - the key or identifier for the document
        `document` - the document that is to be stored
      Returns:
        the document that was previously stored at this key, or null if there was no document with the supplied key

    - #### replace

          public Document replace(String key,
                         Document document)

      Description copied from interface: `DocumentLibrary`
      Replace the existing document at the given key with the document that is supplied. This method does nothing if there is no document at the given key.
      Specified by:
        `replace` in interface `DocumentLibrary`
      Parameters:
        `key` - the key or identifier for the document
        `document` - the document that is to replace the existing document
      Returns:
        the document that was replaced, or null if nothing was replaced

    - #### remove

          public Document remove(String key)

      Description copied from interface: `DocumentLibrary`
      Remove the existing document at the given key.
      Specified by:
        `remove` in interface `DocumentLibrary`
      Parameters:
        `key` - the key or identifier for the document
      Returns:
        the document that was removed, or null if there was no document with the supplied key

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.