Skip to content

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