UTIL_Cache.OperationResult
Class
apex
global inherited sharing class UTIL_Cache.OperationResultResult of a cache operation with detailed status information
Since: 1.0
Fields
| Field | Description |
|---|---|
| global UTIL_Cache.Scope cacheTypeUsed | Cache type used (SESSION, ORG, or null if unavailable) |
| global String errorMessage | Error message if operation failed |
| global Integer keysFound | Number of keys found (for read operations) |
| global Integer keysRequested | Number of keys requested (for bulk operations) |
| global UTIL_Cache.Status status | Detailed status of the operation |
| global Boolean success | Whether the operation succeeded (true for SUCCESS statuses and CACHE_MISS) |
Methods
| Method | Description |
|---|---|
| global OperationResult(Boolean success, UTIL_Cache.Status status, UTIL_Cache.Scope cacheTypeUsed) | Constructor for success result |
| global OperationResult(Boolean success, UTIL_Cache.Status status, UTIL_Cache.Scope cacheTypeAttempted, String errorMessage) | Constructor for failure result |
Method Details
OperationResult
apex
global OperationResult(Boolean success, UTIL_Cache.Status status, UTIL_Cache.Scope cacheTypeUsed)Constructor for success result
Parameters:
success(Boolean) - Whether operation succeededstatus(UTIL_Cache.Status) - Operation statuscacheTypeUsed(UTIL_Cache.Scope) - Cache type used
Since: 1.0
Example:
apex
UTIL_Cache.OperationResult instance = new UTIL_Cache.OperationResult(true, new Status(), new Scope());OperationResult
apex
global OperationResult(Boolean success, UTIL_Cache.Status status, UTIL_Cache.Scope cacheTypeAttempted, String errorMessage)Constructor for failure result
Parameters:
success(Boolean) - Whether operation succeededstatus(UTIL_Cache.Status) - Operation statuscacheTypeAttempted(UTIL_Cache.Scope) - Cache type attemptederrorMessage(String) - Error message
Since: 1.0
Example:
apex
UTIL_Cache.OperationResult instance = new UTIL_Cache.OperationResult(true, new Status(), new Scope(), 'An error occurred');Field Details
cacheTypeUsed
apex
global UTIL_Cache.Scope cacheTypeUsedType: UTIL_Cache.Scope
Cache type used (SESSION, ORG, or null if unavailable)
Since: 1.0
Example:
apex
Scope value = instance.cacheTypeUsed;errorMessage
apex
global String errorMessageType: String
Error message if operation failed
Since: 1.0
Example:
apex
String value = instance.errorMessage;keysFound
apex
global Integer keysFoundType: Integer
Number of keys found (for read operations)
Since: 1.0
Example:
apex
Integer value = instance.keysFound;keysRequested
apex
global Integer keysRequestedType: Integer
Number of keys requested (for bulk operations)
Since: 1.0
Example:
apex
Integer value = instance.keysRequested;status
apex
global UTIL_Cache.Status statusType: UTIL_Cache.Status
Detailed status of the operation
Since: 1.0
Example:
apex
Status value = instance.status;success
apex
global Boolean successType: Boolean
Whether the operation succeeded (true for SUCCESS statuses and CACHE_MISS)
Since: 1.0
Example:
apex
Boolean value = instance.success;