Add and remove members to index automatically #206
Merged
+589
−443
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit updates the ShapeIndex to automatically add and remove
members from shapes that have members. This required some extra
functionality be introduced to shapes which then in turn resulted in
cleanup in other places in the codebase.
added.
contained in the shape (if any). Shapes that have no members just
return an empty collection by default, and shapes that do contain
members override the abstract method.
outside of their containing shapes (since you don't need to
explicitly add them to a shape index), you can now automatically
create member shapes for container shapes by just passing in the
target of the member or passing both the target and a consumer that
accepts the created MemberShape.Builder type. This removes the need
to create the right shape ID for the shape (suffixing with "$" + the
member name).
groups of shape types. The code that was used for that was overly
complicated and likely made it slower rather than faster (the
majority of models will use the prelude and will have more than 50
shapes, so the optimizations that were in place don't really make
sense any more).
UnionShape, I created an abstract class for their shape and builders
to make them simpler to maintain.
method.
insert order. Nothing should ever depend on a stable order based on
inserts since Smithy models can be loaded and aggregated from
multiple sources.
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.