This allows for clients using the DynamoDB Versioned Record Extension to start their versions at 0 instead of null thus preventing clients from being required to use the Integer type and instead allowing them to use the int primitive.
This change also makes the extension more flexible by allowing clients to set the starting value and incrementing value if they have a use-case to do so.
Motivation and Context
Most developers would expect a version to start at 0 and increment from their instead of having to have a special case where the value must be initialized to null (see https://github.com/aws/aws-sdk-java-v2/issues/3894).
Modifications
Updates the internal logic of VersionedRecordExtension to accept either a null value or a numeric value equal to the starting value.
Testing
Added a unit tests for explicitly setting the version to 0 during initial creation.
Screenshots (if appropriate)
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[x] My code follows the code style of this project
[x] My change requires a change to the Javadoc documentation
[x] I have updated the Javadoc documentation accordingly
[x] I have added tests to cover my changes
[x] All new and existing tests passed
[x] I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
[ ] My change is to implement 1.11 parity feature and I have updated LaunchChangelog
License
[x] I confirm that this pull request can be released under the Apache 2 license
This allows for clients using the DynamoDB Versioned Record Extension to start their versions at
0
instead ofnull
thus preventing clients from being required to use theInteger
type and instead allowing them to use theint
primitive. This change also makes the extension more flexible by allowing clients to set the starting value and incrementing value if they have a use-case to do so.Motivation and Context
Most developers would expect a version to start at 0 and increment from their instead of having to have a special case where the value must be initialized to null (see https://github.com/aws/aws-sdk-java-v2/issues/3894).
Modifications
Updates the internal logic of
VersionedRecordExtension
to accept either a null value or a numeric value equal to the starting value.Testing
Added a unit tests for explicitly setting the version to 0 during initial creation.
Screenshots (if appropriate)
Types of changes
Checklist
mvn install
succeedsscripts/new-change
script and following the instructions. Commit the new file created by the script in.changes/next-release
with your changes.License