Package pro.taskana.common.api
Class BulkOperationResults<K,V extends Exception>
- java.lang.Object
-
- pro.taskana.common.api.BulkOperationResults<K,V>
-
-
Constructor Summary
Constructors Constructor Description BulkOperationResults()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllErrors(BulkOperationResults<? extends K,? extends V> log)Add all errors from another BulkOperationResult to this.voidaddError(K objectId, V error)Adding an appearing error to the map and list them by a unique ID as key.voidclearErrors()Clearing the map - all entries will be removed.booleancontainsErrors()Returning the status of a bulk-error-log.VgetErrorForId(K idKey)Returns the stored error for a unique ID or NULL if there is no error stored or ID invalid.Map<K,V>getErrorMap()Returning a list of current errors as map.List<K>getFailedIds()Returns the IDs of the Object with failed requests.BulkOperationResults<K,Exception>mapBulkOperationResults()Map from any exception type to Exception.StringtoString()
-
-
-
Method Detail
-
getErrorMap
public Map<K,V> getErrorMap()
Returning a list of current errors as map. If there are no errors the result will be empty.- Returns:
- map of errors which can't be null.
-
addError
public void addError(K objectId, V error)
Adding an appearing error to the map and list them by a unique ID as key.- Parameters:
objectId- unique key of a entity.error- occurred error of a interaction with the entity
-
containsErrors
public boolean containsErrors()
Returning the status of a bulk-error-log.- Returns:
- true if there are logged errors.
-
getErrorForId
public V getErrorForId(K idKey)
Returns the stored error for a unique ID or NULL if there is no error stored or ID invalid.- Parameters:
idKey- which is mapped with an error- Returns:
- stored error for ID
-
getFailedIds
public List<K> getFailedIds()
Returns the IDs of the Object with failed requests.- Returns:
- a List of IDs that could not be processed successfully.
-
clearErrors
public void clearErrors()
Clearing the map - all entries will be removed.
-
addAllErrors
public void addAllErrors(BulkOperationResults<? extends K,? extends V> log)
Add all errors from another BulkOperationResult to this.- Parameters:
log- the other log
-
mapBulkOperationResults
public BulkOperationResults<K,Exception> mapBulkOperationResults()
Map from any exception type to Exception.- Returns:
- map of errors which can't be null.
-
-