Class DefaultUlidIdGenerator
java.lang.Object
com.broadleafcommerce.common.dataimport.util.DefaultUlidIdGenerator
- All Implemented Interfaces:
 IdResolver
If no id was generated, generates a new one based on a ULID
- Author:
 - Phillip Verheyden (phillipuniverse)
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionprotected static RandomThis provides subclasses the ability to access the sharedSecureRandominstance.nextId()Simply a method to return the next available ID if it can be determined.static StringnextUlid()Static method that allows direct access to generate a ULID.resolveId(String recordType, OperationType suppliedOperation, String suppliedId, Map<String, String> row) Determine the id that should be used forBatchRecord.getResourceTierIdentifier()for the parsed record from a file. 
- 
Constructor Details
- 
DefaultUlidIdGenerator
public DefaultUlidIdGenerator() 
 - 
 - 
Method Details
- 
resolveId
public String resolveId(@Nullable String recordType, @Nullable OperationType suppliedOperation, @Nullable String suppliedId, @Nullable Map<String, String> row) Description copied from interface:IdResolverDetermine the id that should be used forBatchRecord.getResourceTierIdentifier()for the parsed record from a file. While this could be used to generate a default id, the result of this can return null which would move the responsibility of id generation to the resource tier- Specified by:
 resolveIdin interfaceIdResolver- Parameters:
 recordType- the type of record being resolvedsuppliedOperation- the operation that was given by the user in the file, can benullsuppliedId- the primary key resolved from the file, can benullrow- the record parsed from the file- Returns:
 - operation that should be used for the record
 
 - 
nextId
Description copied from interface:IdResolverSimply a method to return the next available ID if it can be determined.- Specified by:
 nextIdin interfaceIdResolver- Returns:
 - the next ID
 
 - 
getRandom
This provides subclasses the ability to access the sharedSecureRandominstance.- Returns:
 - Shared 
SecureRandominstance. 
 - 
nextUlid
Static method that allows direct access to generate a ULID.- Returns:
 - the next available ULID
 
 
 -