com.backendless.transaction.OpResultIdGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk-common Show documentation
Show all versions of java-sdk-common Show documentation
Provides access to Backendless API
The newest version!
package com.backendless.transaction;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
class OpResultIdGenerator
{
private List opResultIdStrings;
private final Map opResultIdMaps = new HashMap<>();
OpResultIdGenerator( List opResultIdStrings )
{
this.opResultIdStrings = opResultIdStrings;
}
String generateOpResultId( OperationType operationType, String tableName )
{
String opResultIdGenerated;
final String key = operationType.getOperationName() + tableName;
if( opResultIdMaps.containsKey( key ) )
{
int count = opResultIdMaps.get( key );
opResultIdMaps.put( key, ++count );
opResultIdGenerated = key + count;
}
else
{
opResultIdMaps.put( key, 1 );
opResultIdGenerated = key + 1;
}
opResultIdStrings.add( opResultIdGenerated );
return opResultIdGenerated;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy