Package me.ahoo.cosid.snowflake
Class SnowflakeIdState.SnowflakeIdStateBuilder
java.lang.Object
me.ahoo.cosid.snowflake.SnowflakeIdState.SnowflakeIdStateBuilder
- Enclosing class:
- SnowflakeIdState
Builder for SnowflakeIdState.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the SnowflakeIdState instance.friendlyId(String friendlyId) Sets the friendly ID string.id(long id) Sets the raw snowflake ID value.machineId(int machineId) Sets the machine ID component.sequence(long sequence) Sets the sequence number component.timestamp(LocalDateTime timestamp) Sets the timestamp component.toString()
-
Method Details
-
id
Sets the raw snowflake ID value.- Parameters:
id- the raw 64-bit ID- Returns:
- this builder
-
machineId
Sets the machine ID component.- Parameters:
machineId- the machine ID- Returns:
- this builder
-
sequence
Sets the sequence number component.- Parameters:
sequence- the sequence number- Returns:
- this builder
-
timestamp
Sets the timestamp component.- Parameters:
timestamp- the timestamp- Returns:
- this builder
-
friendlyId
Sets the friendly ID string.- Parameters:
friendlyId- the friendly ID string- Returns:
- this builder
-
build
Builds the SnowflakeIdState instance.- Returns:
- the built instance
-
toString
-