Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to capture Class<T> type of Context.Key #585

Closed
wants to merge 1 commit into from

Conversation

mtdowling
Copy link
Member

Context.Key now allows you to optionally provide the Class that's contained in the Key. This makes it possible for Context.Key to be adapted to libraries that provide similar typed attributes but require the Class to be available via a getter of the attribute. However, some libraries don't expose Class. To allow smithy-java compatibility with both kinds of libraries, providing a Class when creating a Context.Key is optional.

This allows smithy-java to interop with both kinds of libraries, though it would not be possible to adapt a context key from a library that doesn't expose Class for use with a library that requires Class.

All publicly exposed Context.Keys in smithy-java have been updated to define the Class of the key.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Context.Key now allows you to optionally provide the Class<T> that's
contained in the Key. This makes it possible for Context.Key to be
adapted to libraries that provide similar typed attributes but require
the Class<T> to be available via a getter of the attribute. However,
some libraries don't expose Class<T>. To allow smithy-java
compatibility with both kinds of libraries, providing a Class<T> when
creating a Context.Key is optional.

This allows smithy-java to interop with both kinds of libraries, though
it would not be possible to adapt a context key from a library that
doesn't expose Class<T> for use with a library that requires Class<T>.

All publicly exposed Context.Keys in smithy-java have been updated to
define the Class<T> of the key.
@mtdowling
Copy link
Member Author

Closing for now

@mtdowling mtdowling closed this Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant