Interface TypeRegistry
- All Known Implementing Classes:
DefaultTypeRegistry, NoOpTypeRegistry
public interface TypeRegistry
Interface for resolving registered types by alias or simplified name.
A TypeRegistry is used to look up the fully qualified class name associated with a given alias.
Aliases may be:
- Simple class names (e.g.,
"ProjectCreated") - Shortened fully qualified names (e.g.,
"project.ProjectCreated")
This mechanism is commonly used in deserialization of message payloads or documents, where the
@class property in a JSON object indicates the type name.
Example
If a classcom.example.project.ProjectCreated is registered using RegisterType, the registry may resolve:
getTypeName("ProjectCreated") -> "com.example.project.ProjectCreated"
getTypeName("project.ProjectCreated") -> "com.example.project.ProjectCreated"
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiongetTypeName(String alias) Returns the fully qualified class name associated with the given alias or type key.
-
Method Details
-
getTypeName
Returns the fully qualified class name associated with the given alias or type key.- Parameters:
alias- the name or alias to resolve, typically obtained from@classin JSON- Returns:
- an
Optionalcontaining the resolved fully qualified class name, or empty if not found
-