Class StrategyFactory

java.lang.Object
io.github.arasdenizhan.core.factory.StrategyFactory

public final class StrategyFactory extends Object
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 Details

    • StrategyFactory

      public StrategyFactory()
  • Method Details

    • create

      public ValidationStrategy create(AnnotationName annotationName)
      Returns the ValidationStrategy associated with the given annotation name.
      Parameters:
      annotationName - the annotation name to resolve the strategy for
      Returns:
      the corresponding validation strategy, or null if not supported
    • supports

      public boolean supports(AnnotationName name)
      Checks whether a validation strategy is available for the given annotation.
      Parameters:
      name - the annotation name to check
      Returns:
      true if a strategy is registered for the annotation, false otherwise