public Map<String, Object> getPersistentAttributes() {
        Request request = requestEnvelope.getRequest();
        if (persistenceAdapter == null) {
            throw new IllegalStateException("Attempting to read persistence attributes without configured persistence adapter");
        }
        if (!persistenceAttributesSet) {
            Optional<Map<String, Object>> retrievedAttributes = persistenceAdapter.getAttributes(requestEnvelope);
            if (retrievedAttributes.isPresent()) {
                logger.debug("[{}] Found existing persistence attributes", request.getRequestId());
                persistentAttributes = retrievedAttributes.get();
            } else {
                logger.debug("[{}] No existing persistence attributes", request.getRequestId());
                persistentAttributes = new HashMap<>();
            }
            persistenceAttributesSet = true;
        }
        return persistentAttributes;
    }
public Map < String , Object > getPersistentAttributes ( ) { Request request = requestEnvelope . getRequest ( ) ; if ( persistenceAdapter == null ) { throw new IllegalStateException ( "Attempting to read persistence attributes without configured persistence adapter" ) ; } if ( ! persistenceAttributesSet ) { Optional < Map < String , Object > > retrievedAttributes = persistenceAdapter . getAttributes ( requestEnvelope ) ; if ( retrievedAttributes . isPresent ( ) ) { logger . debug ( "[{}] Found existing persistence attributes" , request . getRequestId ( ) ) ; persistentAttributes = retrievedAttributes . get ( ) ; } else { logger . debug ( "[{}] No existing persistence attributes" , request . getRequestId ( ) ) ; persistentAttributes = new HashMap < > ( ) ; } persistenceAttributesSet = true ; } return persistentAttributes ; }
Retrieves current persistence attributes. If existing persistence attributes are present, they will be contained
in the returned map. If not, an empty map will be returned. Modifications to this map will not be persisted
back unless {@link #savePersistentAttributes()} is called. An exception is thrown if this method is called
when a {@link PersistenceAdapter} is not configured on the SDK.

@return map containing existing persistence attributes, or an empty map if none exist
@throws IllegalStateException if no {@link PersistenceAdapter} is configured