org.infinispan.schematic

## Interface DocumentLibrary

- All Known Subinterfaces:
    SchemaLibrary
  All Known Implementing Classes:
    CacheSchemaLibrary, InMemoryDocumentLibrary, InMemorySchemaLibrary

      public interface DocumentLibrary

  A library of JSON documents.
  Since:
    5.1

- - ### 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.

- - ### Method Detail

    - #### getName

          String getName()

      Get the name of this library.
      Returns:
        the library name; never null

    - #### get

          Document get(String key)

      Get the document with the supplied key.
      Parameters:
        `key` - the key or identifier for the document
      Returns:
        the document, or null if there was no document with the supplied key

    - #### put

          Document put(String key,
                     Document document)

      Store the supplied document at the given key.
      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

          Document putIfAbsent(String key,
                             Document document)

      Store the supplied document at the given key.
      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

          Document replace(String key,
                         Document document)

      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.
      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

          Document remove(String key)

      Remove the existing document at the given key.
      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.