Class ParameterHandlerRegistry
- java.lang.Object
-
- io.testomat.junit.extractor.strategy.ParameterHandlerRegistry
-
public final class ParameterHandlerRegistry extends java.lang.ObjectRegistry 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 Summary
Constructors Constructor Description ParameterHandlerRegistry()Creates a new registry with default handler mappings.ParameterHandlerRegistry(java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,ParameterExtractionHandler> customHandlers)Creates a registry with custom handler mappings for testing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<ParameterExtractionHandler>findHandler(ParameterExtractionContext context)Finds the appropriate handler for the given parameter extraction context.
-
-
-
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
-
-