@Test public void testUnaffected() { Parameters<Untouched> params = FakeParameters.getInstance(Untouched.class, attribs, null, TABLE_NAME, HASH_KEY, RANGE_KEY); Map<String, AttributeValue> encryptedAttributes = encryptor.transform(params); assertEquals(attribs, encryptedAttributes); }
@Override public Map<String, AttributeValue> transform(final Parameters<?> parameters) { final ModelClassMetadata metadata = getModelClassMetadata(parameters); final Map<String, AttributeValue> attributeValues = parameters.getAttributeValues(); if (metadata.doNotTouch) { return attributeValues; } if (parameters.isPartialUpdate()) { throw new DynamoDBMappingException( "Use of AttributeEncryptor without SaveBehavior.PUT or SaveBehavior.CLOBBER is an error " + "and can result in data-corruption. This occured while trying to save " + parameters.getModelClass()); } try { return encryptor.encryptRecord( attributeValues, metadata.getEncryptionFlags(), paramsToContext(parameters)); } catch (Exception ex) { throw new DynamoDBMappingException(ex); } }
AttributeEncryptor implements AttributeTransformer { @Override public Map<String, AttributeValue> transform(final Parameters<?> parameters) { final ModelClassMetadata metadata = getModelClassMetadata(parameters); final Map<String, AttributeValue> attributeValues = parameters.getAttributeValues(); if (metadata.doNotTouch) { return attributeValues; } if (parameters.isPartialUpdate()) { throw new DynamoDBMappingException( "Use of AttributeEncryptor without SaveBehavior.PUT or SaveBehavior.CLOBBER is an error " + "and can result in data-corruption. This occured while trying to save " + parameters.getModelClass()); } try { return encryptor.encryptRecord( attributeValues, metadata.getEncryptionFlags(), paramsToContext(parameters)); } catch (Exception ex) { throw new DynamoDBMappingException(ex); } } }
AttributeEncryptor implements AttributeTransformer { @Override public Map<String, AttributeValue> transform(final Parameters<?> parameters) { final ModelClassMetadata metadata = getModelClassMetadata(parameters); final Map<String, AttributeValue> attributeValues = parameters.getAttributeValues(); if (metadata.doNotTouch) { return attributeValues; } if (parameters.isPartialUpdate()) { throw new DynamoDBMappingException( "Use of AttributeEncryptor without SaveBehavior.PUT or SaveBehavior.CLOBBER is an error " + "and can result in data-corruption. This occured while trying to save " + parameters.getModelClass()); } try { return encryptor.encryptRecord( attributeValues, metadata.getEncryptionFlags(), paramsToContext(parameters)); } catch (Exception ex) { throw new DynamoDBMappingException(ex); } } AttributeEncryptor(final DynamoDBEncryptor encryptor);  AttributeEncryptor(final EncryptionMaterialsProvider encryptionMaterialsProvider); }
AttributeEncryptor implements AttributeTransformer { @Override public Map<String, AttributeValue> transform(final Parameters<?> parameters) { final ModelClassMetadata metadata = getModelClassMetadata(parameters); final Map<String, AttributeValue> attributeValues = parameters.getAttributeValues(); if (metadata.doNotTouch) { return attributeValues; } if (parameters.isPartialUpdate()) { throw new DynamoDBMappingException( "Use of AttributeEncryptor without SaveBehavior.PUT or SaveBehavior.CLOBBER is an error " + "and can result in data-corruption. This occured while trying to save " + parameters.getModelClass()); } try { return encryptor.encryptRecord( attributeValues, metadata.getEncryptionFlags(), paramsToContext(parameters)); } catch (Exception ex) { throw new DynamoDBMappingException(ex); } } AttributeEncryptor(final DynamoDBEncryptor encryptor);  AttributeEncryptor(final EncryptionMaterialsProvider encryptionMaterialsProvider); DynamoDBEncryptor getEncryptor(); @Override Map<String, AttributeValue> transform(final Parameters<?> parameters); @Override Map<String, AttributeValue> untransform(final Parameters<?> parameters); }
AttributeEncryptor implements AttributeTransformer { @Override public Map<String, AttributeValue> transform(final Parameters<?> parameters) { final ModelClassMetadata metadata = getModelClassMetadata(parameters); final Map<String, AttributeValue> attributeValues = parameters.getAttributeValues(); if (metadata.doNotTouch) { return attributeValues; } if (parameters.isPartialUpdate()) { throw new DynamoDBMappingException( "Use of AttributeEncryptor without SaveBehavior.PUT or SaveBehavior.CLOBBER is an error " + "and can result in data-corruption. This occured while trying to save " + parameters.getModelClass()); } try { return encryptor.encryptRecord( attributeValues, metadata.getEncryptionFlags(), paramsToContext(parameters)); } catch (Exception ex) { throw new DynamoDBMappingException(ex); } } AttributeEncryptor(final DynamoDBEncryptor encryptor);  AttributeEncryptor(final EncryptionMaterialsProvider encryptionMaterialsProvider); DynamoDBEncryptor getEncryptor(); @Override Map<String, AttributeValue> transform(final Parameters<?> parameters); @Override Map<String, AttributeValue> untransform(final Parameters<?> parameters);  }