return new SizeValidationRule(size.min(), size.max());
}
if (MinSize.class.isInstance(annotation)) {
MinSize minSize = (MinSize) annotation;
return new MinSizeValidationRule(minSize.value());
}
if (MaxSize.class.isInstance(annotation)) {
MaxSize maxSize = (MaxSize) annotation;
return new MaxSizeValidationRule(maxSize.value());
}