public interface KeyGenerator
KeyGenerator provides methods for getting a unique key for example a serial number. The kind of key depends
on used implementation. It can be a String with numbers ot letters but also data objects can be provided like the
hybris PK class.| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
generate()
Generates a new unique key.
|
java.lang.Object |
generateFor(java.lang.Object object)
Generates a new unique key in relation to given object.
|
void |
reset()
Resets the key generation so that an already generated key can be generated once again.
|
java.lang.Object generate()
reset() method the generator is reseted so that a key
can be returned which already was returned before calling reset().java.lang.Object generateFor(java.lang.Object object)
generate()
method and furthermore it is guaranteed that the key will only be produced for this object (think of a PK which
contains the type information, a media PK will not be generated for a product, nevertheless it is unique overall).object - object for which a key will be generatedvoid reset()
Copyright © 2018 SAP SE. All Rights Reserved.