All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.srplib.validation.StringMaxLengthValidator Maven / Gradle / Ivy

There is a newer version: 0.9.0
Show newest version
package org.srplib.validation;

/**
 * Validates if string length is not more than specified value.
 *
 * @author Q-GMA
 */
public class StringMaxLengthValidator extends StringLengthValidator {
    /**
     * Creates validators with specified range.
     *
     * @param maximum maximal string length (inclusive).
     */
    public StringMaxLengthValidator(int maximum) {
        super(0, maximum);
    }

    protected ValidationError newError() {
        return Validators.newError("Field should be filled with up to " + getMaximum() + " characters");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy