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