Skip to content

Create TypeLiteral Constants #1824

@volosied

Description

@volosied

Originally mentioned by Arjan in the following post:


Map<String, String> headerMap = CDI.current().select(new TypeLiteral<Map<String, String>>() {}, HeaderMap.Literal.INSTANCE).get();

In a way for usability this is quite a step back, but a logical consequence of not allowing raw maps indeed. Maybe we can introduce something like a HeaderMap.TYPE to represent new TypeLiteral<Map<String, String>>() {} for Faces.Next.

Originally posted by @arjantijms in #1723 (comment)


A previous TCK challenge removed the ability to inject into raw Map types (as it was not spec defined), so TypeLiterals (introduced in 4.0) needed parameters to be injected properly into the parametrized types. It would be nice to have new constants to avoid the verbose code above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions