Package dev.adlin.vts4j.event
Class EventRegistry
java.lang.Object
dev.adlin.vts4j.event.EventRegistry
A registry that provides bidirectional mapping between unique event string identifiers
and their respective
Event class types.
This registry is primarily used to resolve event classes during network serialization and request dispatching.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanChecks if the specified event class is registered.static booleanChecks if the specified event name identifier is registered.getEventClass(@NonNull RequestType requestType) Resolves theEventclass associated with the string representation of a request type.getEventClass(@NonNull String eventName) Resolves theEventclass associated with the provided unique event name.static @Nullable StringRetrieves the unique string name identifier for the given event class.
-
Constructor Details
-
EventRegistry
public EventRegistry()
-
-
Method Details
-
getEventClass
Resolves theEventclass associated with the string representation of a request type.- Parameters:
requestType- the request type to resolve from- Returns:
- the associated
Eventclass, ornullif no mapping exists
-
getEventClass
Resolves theEventclass associated with the provided unique event name.- Parameters:
eventName- the string identifier of the event- Returns:
- the associated
Eventclass, ornullif no mapping exists
-
exists
Checks if the specified event class is registered.- Parameters:
eventClass- the event class to verify- Returns:
trueif the class is registered,falseotherwise
-
exists
Checks if the specified event name identifier is registered.- Parameters:
eventName- the string identifier to verify- Returns:
trueif the name is registered,falseotherwise
-
getName
Retrieves the unique string name identifier for the given event class.- Parameters:
eventClass- the registered event class- Returns:
- the string identifier associated with the class, or
nullif not found
-