Class DefaultTypeRegistry

java.lang.Object
io.fluxzero.common.serialization.DefaultTypeRegistry
All Implemented Interfaces:
TypeRegistry

public class DefaultTypeRegistry extends Object implements TypeRegistry
  • Constructor Details

    • DefaultTypeRegistry

      public DefaultTypeRegistry()
    • DefaultTypeRegistry

      protected DefaultTypeRegistry(List<String> candidates)
  • Method Details

    • getTypeNames

      public List<String> getTypeNames()
      Description copied from interface: TypeRegistry
      Returns the fully qualified names that make up this registry.

      Custom registries that only support alias lookup may retain the empty default. The standard registry exposes its generated catalog so structural metadata such as declared model relationships can be discovered without turning those types into message handlers.

      Specified by:
      getTypeNames in interface TypeRegistry
    • getTypeName

      public Optional<String> getTypeName(String alias)
      Description copied from interface: TypeRegistry
      Returns the fully qualified class name associated with the given alias or type key.
      Specified by:
      getTypeName in interface TypeRegistry
      Parameters:
      alias - the name or alias to resolve, typically obtained from @class in JSON
      Returns:
      an Optional containing the resolved fully qualified class name, or empty if not found