Class StrategyFactory
java.lang.Object
io.github.arasdenizhan.core.factory.StrategyFactory
Factory class responsible for providing appropriate
ValidationStrategy instances
based on the given annotation type.
Used internally by the validator to resolve strategy objects for specific annotations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate(AnnotationName annotationName) Returns theValidationStrategyassociated with the given annotation name.booleansupports(AnnotationName name) Checks whether a validation strategy is available for the given annotation.
-
Constructor Details
-
StrategyFactory
public StrategyFactory()
-
-
Method Details
-
create
Returns theValidationStrategyassociated with the given annotation name.- Parameters:
annotationName- the annotation name to resolve the strategy for- Returns:
- the corresponding validation strategy, or
nullif not supported
-
supports
Checks whether a validation strategy is available for the given annotation.- Parameters:
name- the annotation name to check- Returns:
trueif a strategy is registered for the annotation,falseotherwise
-