Package org.apache.hc.client5.http.impl
Class PrefixedIncrementingId
java.lang.Object
org.apache.hc.client5.http.impl.PrefixedIncrementingId
A thread safe incrementing identifier.
- Since:
- 5.1.4
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
count
-
prefix0
-
prefix1
-
prefix2
-
prefix3
-
prefix4
-
prefix5
-
prefix6
-
prefix7
-
prefix8
-
prefix9
-
-
Constructor Details
-
PrefixedIncrementingId
Creates an incrementing identifier.- Parameters:
prefix
- string prefix for generated IDs
-
-
Method Details
-
getNextNumber
public long getNextNumber() -
getNextId
-
createId
Create an ID from this instance's prefix and zero padded specified value. Hand rolled equivalent to `String.format("ex-%010d", value)` optimized to reduce allocation and CPU overhead.
-