protected void encryptAndEncodeAndPutIntoAttributesMap(final Map<String, Object> attributes,
                                                           final Map<String, String> cachedAttributesToEncode,
                                                           final String cachedAttributeName,
                                                           final RegisteredServiceCipherExecutor cipher,
                                                           final RegisteredService registeredService) {
        val cachedAttribute = cachedAttributesToEncode.remove(cachedAttributeName);
        if (StringUtils.isNotBlank(cachedAttribute)) {
            LOGGER.trace("Retrieved [{}] as a cached model attribute...", cachedAttributeName);
            val encodedValue = cipher.encode(cachedAttribute, Optional.of(registeredService));
            if (StringUtils.isNotBlank(encodedValue)) {
                attributes.put(cachedAttributeName, encodedValue);
                LOGGER.trace("Encrypted and encoded [{}] as an attribute to [{}].", cachedAttributeName, encodedValue);
            } else {
                LOGGER.warn("Attribute [{}] cannot be encoded and is removed from the collection of attributes", cachedAttributeName);
            }
        } else {
            LOGGER.trace("[{}] is not available as a cached model attribute to encrypt...", cachedAttributeName);
        }
    }
protected void encryptAndEncodeAndPutIntoAttributesMap ( final Map < String , Object > attributes , final Map < String , String > cachedAttributesToEncode , final String cachedAttributeName , final RegisteredServiceCipherExecutor cipher , final RegisteredService registeredService ) { val cachedAttribute = cachedAttributesToEncode . remove ( cachedAttributeName ) ; if ( StringUtils . isNotBlank ( cachedAttribute ) ) { LOGGER . trace ( "Retrieved [{}] as a cached model attribute..." , cachedAttributeName ) ; val encodedValue = cipher . encode ( cachedAttribute , Optional . of ( registeredService ) ) ; if ( StringUtils . isNotBlank ( encodedValue ) ) { attributes . put ( cachedAttributeName , encodedValue ) ; LOGGER . trace ( "Encrypted and encoded [{}] as an attribute to [{}]." , cachedAttributeName , encodedValue ) ; } else { LOGGER . warn ( "Attribute [{}] cannot be encoded and is removed from the collection of attributes" , cachedAttributeName ) ; } } else { LOGGER . trace ( "[{}] is not available as a cached model attribute to encrypt..." , cachedAttributeName ) ; } }
Encrypt, encode and put the attribute into attributes map.

@param attributes               the attributes
@param cachedAttributesToEncode the cached attributes to encode
@param cachedAttributeName      the cached attribute name
@param cipher                   the cipher
@param registeredService        the registered service