Interface DSnowflakeId.Builder

Enclosing interface:
DSnowflakeId

public static interface DSnowflakeId.Builder
Builder used to create custom DSnowflakeIds.
  • Method Details

    • withEpochStart

      DSnowflakeId.Builder withEpochStart(long epochStart)
      Specify a custom epoch start
      Parameters:
      epochStart - a custom epoch start
      Returns:
      this builder
    • withMachineId

      DSnowflakeId.Builder withMachineId(long machineId)
      Specify a custom machine ID
      Parameters:
      machineId - a custom machine ID
      Returns:
      this builder
    • withMachineBits

      DSnowflakeId.Builder withMachineBits(int machineBits)
      Specify the number of bits to use for the machine ID
      Parameters:
      machineBits - bits to use for the machine ID
      Returns:
      this builder
    • withSequenceBits

      DSnowflakeId.Builder withSequenceBits(int sequenceBits)
      Specify the number of bits to use for the sequence number
      Parameters:
      sequenceBits - buts to use for the sequence number
      Returns:
      this builder
    • build

      DSnowflakeId build()
      Create a DSnowflakeId instance
      Returns:
      a new DSnowflakeId instance