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

[core] Add type() method to SimpleMapper that takes a function that creates JsonAdapter #328

Merged
merged 3 commits into from
Jan 14, 2025

Conversation

rbygrave
Copy link
Contributor

@rbygrave rbygrave commented Jan 14, 2025

Typically, the function is the constructor of the JsonAdapter. This makes it slightly cleaner to create the SimpleMapper.Type, for example:

    SimpleMapper mapper = SimpleMapper.builder().build();
    SimpleMapper.Type<MyCustomType> myType = mapper.type(MyAdapter::new);

…reates JsonAdapter

Typically, the function is the constructor of the JsonAdapter. This makes it slightly cleaner to create the SimpleMapper.Type, for example:

    SimpleMapper mapper = SimpleMapper.builder().build();
    SimpleMapper.Type<MyCustomType> myType = mapper.type(MyAdapter::new);
@rbygrave rbygrave changed the title Feature/adapter function [core] Add type() method to SimpleMapper that takes a function that creates JsonAdapter Jan 14, 2025
@rbygrave rbygrave requested a review from SentryMan January 14, 2025 10:12
@rbygrave rbygrave self-assigned this Jan 14, 2025
@rbygrave rbygrave merged commit a867395 into main Jan 14, 2025
9 checks passed
@rbygrave rbygrave deleted the feature/adapterFunction branch January 14, 2025 18:48
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.

2 participants