Skip to content

Commit

Permalink
HV-819 Unrelated comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gunnarmorling committed Jan 10, 2014
1 parent 2b1a759 commit 2796393
Showing 1 changed file with 9 additions and 7 deletions.
Expand Up @@ -25,7 +25,7 @@
import org.hibernate.validator.internal.util.logging.LoggerFactory;

/**
* Check that a string's length is between min and max.
* Check that a collection's size is between min and max.
*
* @author Hardy Ferentschik
*/
Expand All @@ -36,22 +36,24 @@ public class SizeValidatorForCollection implements ConstraintValidator<Size, Col
private int min;
private int max;

@Override
public void initialize(Size parameters) {
min = parameters.min();
max = parameters.max();
validateParameters();
}

/**
* Checks the number of entries in a map.
* Checks the number of entries in a collection.
*
* @param collection The collection to validate.
* @param constraintValidatorContext context in which the constraint is evaluated.
* @param collection the collection to validate
* @param constraintValidatorContext context in which the constraint is evaluated
*
* @return Returns <code>true</code> if the collection is <code>null</code> or the number of entries in
* <code>collection</code> is between the specified <code>min</code> and <code>max</code> values (inclusive),
* <code>false</code> otherwise.
* @return {@code true} if the collection is {@code null} or the number of entries in
* {@code collection} is between the specified {@code min} and {@code max} values (inclusive),
* {@code false} otherwise.
*/
@Override
public boolean isValid(Collection<?> collection, ConstraintValidatorContext constraintValidatorContext) {
if ( collection == null ) {
return true;
Expand Down

0 comments on commit 2796393

Please sign in to comment.