public class PlainIdGenerator extends java.lang.Object implements IdGenerator
The ID is generated from the a combination of SecureRandom.nextBytes(byte[]), the hashcode of the object, and current timestamp. No guarantees are made for the uniqueness of the ID generated.
In the adapter configuration file this class is aliased as plain-id-generator which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
PlainIdGenerator() |
PlainIdGenerator(java.lang.String separator) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
create(java.lang.Object msg)
Create a unique id based on the object.
|
java.lang.String |
getSeparator() |
void |
setSeparator(java.lang.String s) |
public PlainIdGenerator()
public PlainIdGenerator(java.lang.String separator)
public java.lang.String create(java.lang.Object msg)
IdGenerator
create
in interface IdGenerator
msg
- the object to create an id aroundpublic java.lang.String getSeparator()
public void setSeparator(java.lang.String s)
s
- the separator to set