Skip to content

UTIL_Cache.OperationResult

Class

apex
global inherited sharing class UTIL_Cache.OperationResult

Result of a cache operation with detailed status information

Since: 1.0


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)

Methods

MethodDescription
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:

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:

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 cacheTypeUsed

Type: 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 errorMessage

Type: String

Error message if operation failed

Since: 1.0

Example:

apex
String value = instance.errorMessage;

keysFound

apex
global Integer keysFound

Type: Integer

Number of keys found (for read operations)

Since: 1.0

Example:

apex
Integer value = instance.keysFound;

keysRequested

apex
global Integer keysRequested

Type: Integer

Number of keys requested (for bulk operations)

Since: 1.0

Example:

apex
Integer value = instance.keysRequested;

status

apex
global UTIL_Cache.Status status

Type: UTIL_Cache.Status

Detailed status of the operation

Since: 1.0

Example:

apex
Status value = instance.status;

success

apex
global Boolean success

Type: Boolean

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

Since: 1.0

Example:

apex
Boolean value = instance.success;