public abstract static class AbstTimeBasedFactory.Builder<T,B extends AbstTimeBasedFactory.Builder<T,B>> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected ClockSeqFunction |
clockseqFunction
The clock sequence function.
|
protected NodeIdFunction |
nodeidFunction
The node function.
|
protected TimeFunction |
timeFunction
The time function.
|
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
abstract T |
build()
Finish the factory building.
|
protected ClockSeqFunction |
getClockSeqFunction()
Get the clock sequence function.
|
protected NodeIdFunction |
getNodeIdFunction()
Get the node function.
|
protected TimeFunction |
getTimeFunction()
Get the time function.
|
B |
withClockSeq(byte[] clockseq)
Set a fixed clock sequence.
|
B |
withClockSeq(long clockseq)
Set the fixed clock sequence.
|
B |
withClockSeqFunction(ClockSeqFunction clockseqFunction)
Set the clock sequence function
|
B |
withHashNodeId()
Set the node function to hash strategy.
|
B |
withInstant(Instant instant)
Set the fixed instant.
|
B |
withMacNodeId()
Set the node function to MAC strategy.
|
B |
withNodeId(byte[] nodeid)
Set a fixed node
|
B |
withNodeId(long nodeid)
Set a fixed node.
|
B |
withNodeIdFunction(NodeIdFunction nodeidFunction)
Set the node function
|
B |
withRandomNodeId()
Set the node function to random strategy.
|
B |
withTimeFunction(TimeFunction timeFunction)
Set the time function.
|
protected TimeFunction timeFunction
protected NodeIdFunction nodeidFunction
protected ClockSeqFunction clockseqFunction
protected TimeFunction getTimeFunction()
protected NodeIdFunction getNodeIdFunction()
protected ClockSeqFunction getClockSeqFunction()
public B withTimeFunction(TimeFunction timeFunction)
timeFunction - a functionpublic B withNodeIdFunction(NodeIdFunction nodeidFunction)
nodeidFunction - a functionpublic B withClockSeqFunction(ClockSeqFunction clockseqFunction)
clockseqFunction - a functionpublic B withInstant(Instant instant)
instant - an instantpublic B withClockSeq(long clockseq)
clockseq - a clock sequencepublic B withClockSeq(byte[] clockseq)
clockseq - a clock sequencepublic B withNodeId(long nodeid)
nodeid - a nodepublic B withNodeId(byte[] nodeid)
nodeid - a nodepublic B withMacNodeId()
public B withHashNodeId()
public B withRandomNodeId()
public abstract T build()
Copyright © 2024. All rights reserved.