org.infinispan.schematic

## Class DocumentFactory

- java.lang.Object
- - org.infinispan.schematic.DocumentFactory

- Direct Known Subclasses:
    Schematic

      public class DocumentFactory
      extends Object

  Factory class that creates `EditableDocument` instances

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static DocumentValueFactory` | `DEFAULT_FACTORY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocumentFactory()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static EditableArray` | `newArray()` Create a new, empty editable array that can be used as a new array value in other documents.
    `static EditableArray` | `newArray(Collection<?> values)` Create a new editable array that can be used as a new array value in other documents.
    `static EditableArray` | `newArray(int initialCapacity)` Create a new, empty editable array that can be used as a new array value in other documents.
    `static EditableArray` | `newArray(Object... values)` Create a new editable array that can be used as a new array value in other documents.
    `static EditableDocument` | `newDocument()` Create a new editable document that can be used as a new document entry in a SchematicDb or as nested documents for other documents.
    `static EditableDocument` | `newDocument(Document original)` Create a new editable document that is a copy of the supplied document.
    `static EditableDocument` | `newDocument(String name, Object value)` Create a new editable document, initialized with a single field, that can be used as a new document entry in a SchematicDb or as nested documents for other documents.
    `static EditableDocument` | `newDocument(String name1, Object value1, String name2, Object value2)` Create a new editable document, initialized with two fields, that can be used as a new document entry in a SchematicDb or as nested documents for other documents.
    `static EditableDocument` | `newDocument(String name1, Object value1, String name2, Object value2, String name3, Object value3)` Create a new editable document, initialized with three fields, that can be used as a new document entry in a SchematicDb or as nested documents for other documents.
    `static EditableDocument` | `newDocument(String name1, Object value1, String name2, Object value2, String name3, Object value3, String name4, Object value4)` Create a new editable document, initialized with four fields, that can be used as a new document entry in a SchematicDb or as nested documents for other documents.

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

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

- - ### Field Detail

    - #### DEFAULT_FACTORY

          protected static DocumentValueFactory DEFAULT_FACTORY

  - ### Constructor Detail

    - #### DocumentFactory

          public DocumentFactory()

  - ### Method Detail

    - #### newDocument

          public static EditableDocument newDocument(Document original)

      Create a new editable document that is a copy of the supplied document.
      Parameters:
        `original` - the original document
      Returns:
        the editable document; never null

    - #### newDocument

          public static EditableDocument newDocument()

      Create a new editable document that can be used as a new document entry in a SchematicDb or as nested documents for other documents.
      Returns:
        the editable document; never null

    - #### newDocument

          public static EditableDocument newDocument(String name,
                                     Object value)

      Create a new editable document, initialized with a single field, that can be used as a new document entry in a SchematicDb or as nested documents for other documents.
      Parameters:
        `name` - the name of the initial field in the resulting document; if null, the field will not be added to the returned document
        `value` - the value of the initial field in the resulting document
      Returns:
        the editable document; never null

    - #### newDocument

          public static EditableDocument newDocument(String name1,
                                     Object value1,
                                     String name2,
                                     Object value2)

      Create a new editable document, initialized with two fields, that can be used as a new document entry in a SchematicDb or as nested documents for other documents.
      Parameters:
        `name1` - the name of the first field in the resulting document; if null, the field will not be added to the returned document
        `value1` - the value of the first field in the resulting document
        `name2` - the name of the second field in the resulting document; if null, the field will not be added to the returned document
        `value2` - the value of the second field in the resulting document
      Returns:
        the editable document; never null

    - #### newDocument

          public static EditableDocument newDocument(String name1,
                                     Object value1,
                                     String name2,
                                     Object value2,
                                     String name3,
                                     Object value3)

      Create a new editable document, initialized with three fields, that can be used as a new document entry in a SchematicDb or as nested documents for other documents.
      Parameters:
        `name1` - the name of the first field in the resulting document; if null, the field will not be added to the returned document
        `value1` - the value of the first field in the resulting document
        `name2` - the name of the second field in the resulting document; if null, the field will not be added to the returned document
        `value2` - the value of the second field in the resulting document
        `name3` - the name of the third field in the resulting document; if null, the field will not be added to the returned document
        `value3` - the value of the third field in the resulting document
      Returns:
        the editable document; never null

    - #### newDocument

          public static EditableDocument newDocument(String name1,
                                     Object value1,
                                     String name2,
                                     Object value2,
                                     String name3,
                                     Object value3,
                                     String name4,
                                     Object value4)

      Create a new editable document, initialized with four fields, that can be used as a new document entry in a SchematicDb or as nested documents for other documents.
      Parameters:
        `name1` - the name of the first field in the resulting document; if null, the field will not be added to the returned document
        `value1` - the value of the first field in the resulting document
        `name2` - the name of the second field in the resulting document; if null, the field will not be added to the returned document
        `value2` - the value of the second field in the resulting document
        `name3` - the name of the third field in the resulting document; if null, the field will not be added to the returned document
        `value3` - the value of the third field in the resulting document
        `name4` - the name of the fourth field in the resulting document; if null, the field will not be added to the returned document
        `value4` - the value of the fourth field in the resulting document
      Returns:
        the editable document; never null

    - #### newArray

          public static EditableArray newArray()

      Create a new, empty editable array that can be used as a new array value in other documents.
      Returns:
        the editable array; never null

    - #### newArray

          public static EditableArray newArray(int initialCapacity)

      Create a new, empty editable array that can be used as a new array value in other documents.
      Parameters:
        `initialCapacity` - the initial allocated capacity for the array
      Returns:
        the editable array; never null

    - #### newArray

          public static EditableArray newArray(Collection<?> values)

      Create a new editable array that can be used as a new array value in other documents.
      Parameters:
        `values` - the initial values for the array
      Returns:
        the editable array; never null

    - #### newArray

          public static EditableArray newArray(Object... values)

      Create a new editable array that can be used as a new array value in other documents.
      Parameters:
        `values` - the initial values for the array
      Returns:
        the editable array; never null

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