com.hazelcast.client.config

## Class ClientFlakeIdGeneratorConfig

- java.lang.Object
- - com.hazelcast.client.config.ClientFlakeIdGeneratorConfig

-     public class ClientFlakeIdGeneratorConfig
      extends Object

  The `ClientFlakeIdGeneratorConfig` contains the configuration for the client regarding `Flake ID Generator`.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientFlakeIdGeneratorConfig(ClientFlakeIdGeneratorConfig other)` Copy-constructor
    `ClientFlakeIdGeneratorConfig(String name)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `String` | `getName()` Returns the configuration name.
    `int` | `getPrefetchCount()`
    `long` | `getPrefetchValidityMillis()`
    `int` | `hashCode()`
    `void` | `setName(String name)` Sets the name or name pattern for this config.
    `ClientFlakeIdGeneratorConfig` | `setPrefetchCount(int prefetchCount)` Sets how many IDs are pre-fetched on the background when one call to `FlakeIdGenerator.newId()` is made.
    `ClientFlakeIdGeneratorConfig` | `setPrefetchValidityMillis(long prefetchValidityMs)` Sets for how long the pre-fetched IDs can be used.
    `String` | `toString()`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### ClientFlakeIdGeneratorConfig

          public ClientFlakeIdGeneratorConfig(String name)

    - #### ClientFlakeIdGeneratorConfig

          public ClientFlakeIdGeneratorConfig(ClientFlakeIdGeneratorConfig other)

      Copy-constructor

  - ### Method Detail

    - #### getName

          public String getName()

      Returns the configuration name. This can be actual object name or pattern.

    - #### setName

          public void setName(String name)

      Sets the name or name pattern for this config. Must not be modified after this instance is added to `ClientConfig`.

    - #### getPrefetchCount

          public int getPrefetchCount()

      See Also:
        `setPrefetchCount(int)`

    - #### setPrefetchCount

          public ClientFlakeIdGeneratorConfig setPrefetchCount(int prefetchCount)

      Sets how many IDs are pre-fetched on the background when one call to `FlakeIdGenerator.newId()` is made. Default is 100.
      Parameters:
        `prefetchCount` - the desired prefetch count, in the range 1..100,000.
      Returns:
        this instance for fluent API

    - #### getPrefetchValidityMillis

          public long getPrefetchValidityMillis()

      See Also:
        `setPrefetchValidityMillis(long)`

    - #### setPrefetchValidityMillis

          public ClientFlakeIdGeneratorConfig setPrefetchValidityMillis(long prefetchValidityMs)

      Sets for how long the pre-fetched IDs can be used. If this time elapses, a new batch of IDs will be fetched. Time unit is milliseconds, default is 600,000 (10 minutes).

      The IDs contain timestamp component, which ensures rough global ordering of IDs. If an ID is assigned to an object that was created much later, it will be much out of order. If you don't care about ordering, set this value to 0.

      Parameters:
        `prefetchValidityMs` - the desired ID validity or unlimited, if <=0
      Returns:
        this instance for fluent API

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2019. All rights reserved.