Skip to content

Commit 5d38de1

Browse files
committed
chore: format
1 parent 0bfc9ef commit 5d38de1

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

examples/src/main/java/com/amazonaws/examples/EncryptionContextOverridesWithDynamoDBMapper.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
* "partition_attribute" for Strings and a sort (range) key named "sort_attribute" for numbers.
4747
*/
4848
public class EncryptionContextOverridesWithDynamoDBMapper {
49-
public static final String ORIGINAL_TABLE_NAME_TO_OVERRIDE = "ExampleTableForEncryptionContextOverrides";
49+
public static final String ORIGINAL_TABLE_NAME_TO_OVERRIDE =
50+
"ExampleTableForEncryptionContextOverrides";
5051
public static final String PARTITION_ATTRIBUTE = "partition_attribute";
5152
public static final String SORT_ATTRIBUTE = "sort_attribute";
5253

sdk1/src/main/java/com/amazonaws/services/dynamodbv2/datamodeling/encryption/utils/EncryptionContextOperators.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,18 @@ public class EncryptionContextOperators {
2525
private EncryptionContextOperators() {}
2626

2727
/**
28-
* An operator for overriding EncryptionContext's table name for a specific DynamoDBEncryptor.
29-
* If any table names or the encryption context is null, it returns the original EncryptionContext.
28+
* An operator for overriding EncryptionContext's table name for a specific DynamoDBEncryptor. If
29+
* any table names or the encryption context is null, it returns the original EncryptionContext.
3030
*
31-
* The client automatically adds the current table name to the encryption context
32-
* so it's bound to the ciphertext.
33-
* Use this method when the encryption context of encrypted table items includes a different table name,
34-
* such as when a table is backed up, or table items are moved/copied to a different table.
35-
* If you don't override the name of the current table
36-
* with the table name in the encryption context, decrypt fails.
37-
* This override affects the encryption context of all table items,
38-
* including newly encrypted items.
31+
* <p>The client automatically adds the current table name to the encryption context so it's bound
32+
* to the ciphertext. Use this method when the encryption context of encrypted table items
33+
* includes a different table name, such as when a table is backed up, or table items are
34+
* moved/copied to a different table. If you don't override the name of the current table with the
35+
* table name in the encryption context, decrypt fails. This override affects the encryption
36+
* context of all table items, including newly encrypted items.
3937
*
4038
* @param originalTableName Use this table name in the encryption context
41-
* @param currentTableName Override this table name in the encryption context
39+
* @param currentTableName Override this table name in the encryption context
4240
* @return A UnaryOperator that produces a new EncryptionContext with the supplied table name
4341
*/
4442
public static UnaryOperator<EncryptionContext> overrideEncryptionContextTableName(
@@ -51,7 +49,9 @@ public static UnaryOperator<EncryptionContext> overrideEncryptionContextTableNam
5149
return encryptionContext;
5250
}
5351
if (originalTableName.equals(encryptionContext.getTableName())) {
54-
return new EncryptionContext.Builder(encryptionContext).withTableName(currentTableName).build();
52+
return new EncryptionContext.Builder(encryptionContext)
53+
.withTableName(currentTableName)
54+
.build();
5555
} else {
5656
return encryptionContext;
5757
}

0 commit comments

Comments
 (0)