-
Notifications
You must be signed in to change notification settings - Fork 858
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add DynamoDbIgnoreNulls to support ignoreNulls in nested beans
- Loading branch information
Showing
15 changed files
with
575 additions
and
30 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
.changes/next-release/feature-DynamoDBEnhancedClient-865ea0b.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"category": "DynamoDB Enhanced Client", | ||
"contributor": "", | ||
"type": "feature", | ||
"description": "Added `DynamoDbIgnoreNulls` attribute level annotation that specifies attributes with null values should be ignored. See [#2303](https://github.com/aws/aws-sdk-java-v2/issues/2303)" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...c/main/java/software/amazon/awssdk/enhanced/dynamodb/internal/AttributeConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"). | ||
* You may not use this file except in compliance with the License. | ||
* A copy of the License is located at | ||
* | ||
* http://aws.amazon.com/apache2.0 | ||
* | ||
* or in the "license" file accompanying this file. This file is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
*/ | ||
|
||
package software.amazon.awssdk.enhanced.dynamodb.internal; | ||
|
||
import software.amazon.awssdk.annotations.SdkInternalApi; | ||
|
||
/** | ||
* Internal configuration for attribute | ||
*/ | ||
@SdkInternalApi | ||
public final class AttributeConfiguration { | ||
private final boolean preserveEmptyObject; | ||
private final boolean ignoreNulls; | ||
|
||
public AttributeConfiguration(Builder builder) { | ||
this.preserveEmptyObject = builder.preserveEmptyObject; | ||
this.ignoreNulls = builder.ignoreNulls; | ||
} | ||
|
||
public boolean preserveEmptyObject() { | ||
return preserveEmptyObject; | ||
} | ||
|
||
public boolean ignoreNulls() { | ||
return ignoreNulls; | ||
} | ||
|
||
public static Builder builder() { | ||
return new Builder(); | ||
} | ||
|
||
public static final class Builder { | ||
private boolean preserveEmptyObject; | ||
private boolean ignoreNulls; | ||
|
||
private Builder() { | ||
} | ||
|
||
public Builder preserveEmptyObject(boolean preserveEmptyObject) { | ||
this.preserveEmptyObject = preserveEmptyObject; | ||
return this; | ||
} | ||
|
||
public Builder ignoreNulls(boolean ignoreNulls) { | ||
this.ignoreNulls = ignoreNulls; | ||
return this; | ||
} | ||
|
||
public AttributeConfiguration build() { | ||
return new AttributeConfiguration(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.