Skip to content

Conversation

@NotJustAnna
Copy link
Member

Creates a utility class Types, which aims to replace some TypeReference generic classes across the driver main and test code, as well as expose it to the driver users.

Examples:

new TypeReference<Map<String, Object>>() {};
// turns into
Types.mapOf(String.class, Object.class);
new TypeReference<List<String>>() {};
// turns into
Types.listOf(String.class);

Building generics types are faster than loading them from type information because that amounts to one class load per type reference, versus a few invoke calls and load constants.

Yes, I reverse-engineered the type system and Jackson type system to make this.

@NotJustAnna NotJustAnna merged commit 15051be into develop Mar 5, 2020
@NotJustAnna NotJustAnna deleted the feature/type-utils branch March 5, 2020 12:12
@NotJustAnna NotJustAnna added this to the v2.4.2 milestone Mar 22, 2020
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