Skip to content

Reactions map should use enum as a key #46

@kestivvi

Description

@kestivvi

In WebSocketSplendorServer class there is the reactions field (See the codeblock below). It maps type of request (string) to the appropriate reaction class (request handler). It's safer to use enum as a key, there is created ReactionType enum for this purpose.

Changing this involves tinkering with ReactionManager class and it uses reflection a lot. It's an relatively easy task, but you have to know reflection a bit.

public class WebSocketSplendorServer extends WebSocketServer {
private Map<String, Class<? extends Reaction>> reactions;

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: 🙂🙂Below average taskscope: 🛠️it's job for developerstype: refactorno change in functionality, but in mechanizm under the hood, improving performance or security

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions