Skip to content

UTIL_Cache.OperationResult

Class

apex
global inherited sharing class UTIL_Cache.OperationResult

Result of a cache operation with detailed status information


Constructors

ConstructorDescription
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

ParameterTypeDescription
successBooleanWhether operation succeeded
statusUTIL_Cache.StatusOperation status
cacheTypeUsedUTIL_Cache.ScopeCache 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

ParameterTypeDescription
successBooleanWhether operation succeeded
statusUTIL_Cache.StatusOperation status
cacheTypeAttemptedUTIL_Cache.ScopeCache type attempted
errorMessageStringError message

Example

apex
UTIL_Cache.OperationResult instance = new UTIL_Cache.OperationResult(true, new Status(), new Scope(), 'An error occurred');

Fields

FieldDescription
global UTIL_Cache.Scope cacheTypeUsedCache type used (SESSION, ORG, or null if unavailable)
global String errorMessageError message if operation failed
global Integer keysFoundNumber of keys found (for read operations)
global Integer keysRequestedNumber of keys requested (for bulk operations)
global UTIL_Cache.Status statusDetailed status of the operation
global Boolean successWhether the operation succeeded (true for SUCCESS statuses and CACHE_MISS)

cacheTypeUsed

apex
global UTIL_Cache.Scope cacheTypeUsed

Type: UTIL_Cache.Scope

Cache type used (SESSION, ORG, or null if unavailable)

Example

apex
Scope value = instance.cacheTypeUsed;

errorMessage

apex
global String errorMessage

Type: String

Error message if operation failed

Example

apex
String value = instance.errorMessage;

keysFound

apex
global Integer keysFound

Type: Integer

Number of keys found (for read operations)

Example

apex
Integer value = instance.keysFound;

keysRequested

apex
global Integer keysRequested

Type: Integer

Number of keys requested (for bulk operations)

Example

apex
Integer value = instance.keysRequested;

status

apex
global UTIL_Cache.Status status

Type: UTIL_Cache.Status

Detailed status of the operation

Example

apex
Status value = instance.status;

success

apex
global Boolean success

Type: Boolean

Whether the operation succeeded (true for SUCCESS statuses and CACHE_MISS)

Example

apex
Boolean value = instance.success;