Class ParameterHandlerRegistry


  • public final class ParameterHandlerRegistry
    extends java.lang.Object
    Registry that maintains direct mapping between JUnit parameter source annotations and their corresponding extraction handlers.

    This registry provides O(1) handler lookup based on annotation type, eliminating the need for priority-based selection and filtering operations.

    Since:
    1.0
    • Constructor Detail

      • ParameterHandlerRegistry

        public ParameterHandlerRegistry()
        Creates a new registry with default handler mappings.
      • ParameterHandlerRegistry

        public ParameterHandlerRegistry​(java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,​ParameterExtractionHandler> customHandlers)
        Creates a registry with custom handler mappings for testing.
        Parameters:
        customHandlers - the custom handler mappings
    • Method Detail

      • findHandler

        public java.util.Optional<ParameterExtractionHandler> findHandler​(ParameterExtractionContext context)
        Finds the appropriate handler for the given parameter extraction context.
        Parameters:
        context - the parameter extraction context
        Returns:
        the matching handler, or empty if no handler found
        Throws:
        java.lang.IllegalStateException - if multiple conflicting handlers are found