TupleSerialFactory (Oracle - Berkeley DB Client-Server API)
Date: 2018-05-29

com.sleepycat.client.collections

## Class TupleSerialFactory

- java.lang.Object
- - com.sleepycat.client.collections.TupleSerialFactory

-     public class TupleSerialFactory
      extends java.lang.Object

  Creates stored collections having tuple keys and serialized entity values. The entity classes must be Serializable and must implement the MarshalledTupleKeyEntity interfaces. The key classes must either implement the MarshalledTupleEntry interface or be one of the Java primitive type classes. Underlying binding objects are created automatically.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TupleSerialFactory(com.sleepycat.client.bind.serial.ClassCatalog catalog)` Creates a tuple-serial factory for given environment and class catalog.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.sleepycat.client.bind.serial.ClassCatalog` | `getCatalog()` Returns the class catalog associated with this factory.
    `<V extends com.sleepycat.client.bind.tuple.MarshalledTupleKeyEntity> com.sleepycat.client.bind.serial.TupleSerialMarshalledBinding<V>` | `getEntityBinding(java.lang.Class<V> baseClass)`
    `<V extends com.sleepycat.client.bind.tuple.MarshalledTupleKeyEntity> com.sleepycat.client.bind.serial.TupleSerialMarshalledKeyCreator<V>` | `getKeyCreator(java.lang.Class<V> valueBaseClass, java.lang.String keyName)` Creates a `SecondaryKeyCreator` object for use in configuring a `SecondaryDatabase`.
    `<K,V extends com.sleepycat.client.bind.tuple.MarshalledTupleKeyEntity> StoredMap<K,V>` | `newMap(SDatabase db, java.lang.Class<K> keyClass, java.lang.Class<V> valueBaseClass, boolean writeAllowed)` Creates a map from a previously opened SDatabase object.
    `<K,V extends com.sleepycat.client.bind.tuple.MarshalledTupleKeyEntity> StoredSortedMap<K,V>` | `newSortedMap(SDatabase db, java.lang.Class<K> keyClass, java.lang.Class<V> valueBaseClass, boolean writeAllowed)` Creates a sorted map from a previously opened SDatabase object.

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

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

- - ### Constructor Detail

    - #### TupleSerialFactory

          public TupleSerialFactory(com.sleepycat.client.bind.serial.ClassCatalog catalog)

      Creates a tuple-serial factory for given environment and class catalog.
      Parameters:
        `catalog` - the ClassCatalog.

  - ### Method Detail

    - #### getCatalog

          public final com.sleepycat.client.bind.serial.ClassCatalog getCatalog()

      Returns the class catalog associated with this factory.
      Returns:
        the catalog.

    - #### newMap

          public <K,V extends com.sleepycat.client.bind.tuple.MarshalledTupleKeyEntity> StoredMap<K,V> newMap(SDatabase db,
                                                                                                              java.lang.Class<K> keyClass,
                                                                                                              java.lang.Class<V> valueBaseClass,
                                                                                                              boolean writeAllowed)

      Creates a map from a previously opened SDatabase object.
      Type Parameters:
        `K` - the key class.
        `V` - the value base class.
      Parameters:
        `db` - the previously opened SDatabase object.
        `keyClass` - is the class used for map keys. It must implement the `MarshalledTupleEntry` interface or be one of the Java primitive type classes.
        `valueBaseClass` - the base class of the entity values for this store. It must implement the `MarshalledTupleKeyEntity` interface.
        `writeAllowed` - is true to create a read-write collection or false to create a read-only collection.
      Returns:
        the map.

    - #### newSortedMap

          public <K,V extends com.sleepycat.client.bind.tuple.MarshalledTupleKeyEntity> StoredSortedMap<K,V> newSortedMap(SDatabase db,
                                                                                                                          java.lang.Class<K> keyClass,
                                                                                                                          java.lang.Class<V> valueBaseClass,
                                                                                                                          boolean writeAllowed)

      Creates a sorted map from a previously opened SDatabase object.
      Type Parameters:
        `K` - the key class.
        `V` - the value base class.
      Parameters:
        `db` - the previously opened SDatabase object.
        `keyClass` - is the class used for map keys. It must implement the `MarshalledTupleEntry` interface or be one of the Java primitive type classes.
        `valueBaseClass` - the base class of the entity values for this store. It must implement the `MarshalledTupleKeyEntity` interface.
        `writeAllowed` - is true to create a read-write collection or false to create a read-only collection.
      Returns:
        the sorted map.

    - #### getKeyCreator

          public <V extends com.sleepycat.client.bind.tuple.MarshalledTupleKeyEntity> com.sleepycat.client.bind.serial.TupleSerialMarshalledKeyCreator<V> getKeyCreator(java.lang.Class<V> valueBaseClass,
                                                                                                                                                                        java.lang.String keyName)

      Creates a `SecondaryKeyCreator` object for use in configuring a `SecondaryDatabase`. The returned object implements the `SSecondaryKeyCreator` interface.
      Type Parameters:
        `V` - the value base class.
      Parameters:
        `valueBaseClass` - the base class of the entity values for this store. It must implement the `MarshalledTupleKeyEntity` interface.
        `keyName` - is the key name passed to the `MarshalledTupleKeyEntity.marshalSecondaryKey(java.lang.String, com.sleepycat.client.bind.tuple.TupleOutput)` method to identify the secondary key.
      Returns:
        the key creator.

    - #### getEntityBinding

          public <V extends com.sleepycat.client.bind.tuple.MarshalledTupleKeyEntity> com.sleepycat.client.bind.serial.TupleSerialMarshalledBinding<V> getEntityBinding(java.lang.Class<V> baseClass)

Copyright (c) 2016, 2018 Oracle and/or its affiliates. All rights reserved.