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

com.sleepycat.client

## Class SSequenceConfig

- java.lang.Object
- - com.sleepycat.client.SSequenceConfig

-     public class SSequenceConfig
      extends java.lang.Object

  Specify the attributes of a sequence.

  For a user created instance, no attribute is set by default. In addition, calling the getter method of an unset attribute results in an IllegalStateException. To set an attribute, call the setter method of the attribute.

  When used to create a sequence, system default values are used for unset attributes.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `SSequenceConfig()` Create an empty SSequenceConfig with no attribute set.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `getAllowCreate()` Return true if the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method is configured to create the sequence if it does not already exist.
    `boolean` | `getAutoCommitNoSync()` Return true if the auto-commit operations on the sequence are configure to not flush the transaction log.
    `int` | `getCacheSize()` Return the number of elements cached by a sequence handle.
    `boolean` | `getDecrement()` Return true if the sequence is configured to decrement.
    `boolean` | `getExclusiveCreate()` Return true if the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method is configured to fail if the database already exists.
    `protected java.lang.Object` | `getField(F field)` Return the value set on a specified field.
    `long` | `getInitialValue()` Return the initial value for a sequence.
    `long` | `getRangeMax()` Return the maximum value for the sequence.
    `long` | `getRangeMin()` Return the minimum value for the sequence.
    `protected T` | `getThriftObj()`
    `boolean` | `getWrap()` Return true if the sequence will wrap around when it is incremented (decremented) past the specified maximum (minimum) value.
    `SSequenceConfig` | `setAllowCreate(boolean allowCreate)` Configure the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method to create the sequence if it does not already exist.
    `SSequenceConfig` | `setAutoCommitNoSync(boolean autoCommitNoSync)` Configure auto-commit operations on the sequence to not flush the transaction log.
    `SSequenceConfig` | `setCacheSize(int cacheSize)` Set the number of elements cached by a sequence handle.
    `SSequenceConfig` | `setDecrement(boolean decrement)` Specify that the sequence should be decremented.
    `SSequenceConfig` | `setExclusiveCreate(boolean exclusiveCreate)` Configure the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method to fail if the database already exists.
    `SSequenceConfig` | `setInitialValue(long initialValue)` Set the initial value for a sequence.
    `SSequenceConfig` | `setRange(long min, long max)` Configure a sequence range.
    `SSequenceConfig` | `setWrap(boolean wrap)` Specify that the sequence should wrap around when it is incremented (decremented) past the specified maximum (minimum) value.

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

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

- - ### Constructor Detail

    - #### SSequenceConfig

          public SSequenceConfig()

      Create an empty SSequenceConfig with no attribute set.

  - ### Method Detail

    - #### getAllowCreate

          public boolean getAllowCreate()

      Return true if the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method is configured to create the sequence if it does not already exist.
      Returns:
        true if the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method is configured to create the sequence if it does not already exist.

    - #### setAllowCreate

          public SSequenceConfig setAllowCreate(boolean allowCreate)

      Configure the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method to create the sequence if it does not already exist.
      Parameters:
        `allowCreate` - if true, configure the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method to create the sequence if it does not already exist
      Returns:
        this

    - #### getAutoCommitNoSync

          public boolean getAutoCommitNoSync()

      Return true if the auto-commit operations on the sequence are configure to not flush the transaction log.
      Returns:
        true if the auto-commit operations on the sequence are configure to not flush the transaction log

    - #### setAutoCommitNoSync

          public SSequenceConfig setAutoCommitNoSync(boolean autoCommitNoSync)

      Configure auto-commit operations on the sequence to not flush the transaction log.
      Parameters:
        `autoCommitNoSync` - if true, configure auto-commit operations on the sequence to not flush the transaction log
      Returns:
        this

    - #### getCacheSize

          public int getCacheSize()

      Return the number of elements cached by a sequence handle.
      Returns:
        the number of elements cached by a sequence handle

    - #### setCacheSize

          public SSequenceConfig setCacheSize(int cacheSize)

      Set the number of elements cached by a sequence handle.
      Parameters:
        `cacheSize` - the number of elements cached by a sequence handle
      Returns:
        this

    - #### getDecrement

          public boolean getDecrement()

      Return true if the sequence is configured to decrement.
      Returns:
        true if the sequence is configured to decrement

    - #### setDecrement

          public SSequenceConfig setDecrement(boolean decrement)

      Specify that the sequence should be decremented.
      Parameters:
        `decrement` - if true, specify that the sequence should be decremented
      Returns:
        this

    - #### getExclusiveCreate

          public boolean getExclusiveCreate()

      Return true if the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method is configured to fail if the database already exists.
      Returns:
        true if the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method is configured to fail if the database already exists

    - #### setExclusiveCreate

          public SSequenceConfig setExclusiveCreate(boolean exclusiveCreate)

      Configure the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method to fail if the database already exists.
      Parameters:
        `exclusiveCreate` - if true, configure the `SDatabase.openSequence(com.sleepycat.client.STransaction, com.sleepycat.client.SDatabaseEntry, com.sleepycat.client.SSequenceConfig)` method to fail if the database already exists
      Returns:
        this

    - #### getInitialValue

          public long getInitialValue()

      Return the initial value for a sequence.
      Returns:
        the initial value for a sequence

    - #### setInitialValue

          public SSequenceConfig setInitialValue(long initialValue)

      Set the initial value for a sequence.

      This call is only effective when the sequence is being created.

      Parameters:
        `initialValue` - the initial value for a sequence
      Returns:
        this

    - #### getRangeMin

          public long getRangeMin()

      Return the minimum value for the sequence.
      Returns:
        the minimum value for the sequence

    - #### getRangeMax

          public long getRangeMax()

      Return the maximum value for the sequence.
      Returns:
        the maximum value for the sequence

    - #### setRange

          public SSequenceConfig setRange(long min,
                                          long max)

      Configure a sequence range.

      This call is only effective when the sequence is being created.

      Parameters:
        `min` - the minimum value for the sequence
        `max` - the maximum value for the sequence
      Returns:
        this

    - #### getWrap

          public boolean getWrap()

      Return true if the sequence will wrap around when it is incremented (decremented) past the specified maximum (minimum) value.
      Returns:
        true if the sequence will wrap around when it is incremented (decremented) past the specified maximum (minimum) value

    - #### setWrap

          public SSequenceConfig setWrap(boolean wrap)

      Specify that the sequence should wrap around when it is incremented (decremented) past the specified maximum (minimum) value.
      Parameters:
        `wrap` - if true, specify that the sequence should wrap around when it is incremented (decremented) past the specified maximum (minimum) value
      Returns:
        this

    - #### getThriftObj

          protected T getThriftObj()

    - #### getField

          protected java.lang.Object getField(F field)
                                       throws java.lang.IllegalStateException

      Return the value set on a specified field. Throw IllegalStateException if the field is not set.
      Parameters:
        `field` - the field
      Returns:
        the field's value
      Throws:
        `java.lang.IllegalStateException` - if the field is not set

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