io.higgs.http.server.params.DefaultValidator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http-s3 Show documentation
Show all versions of http-s3 Show documentation
Higgs HTTP S3 (Single Site Server)
package io.higgs.http.server.params;
import io.higgs.http.server.MethodParam;
/**
* @author Courtney Robinson
*/
public class DefaultValidator implements Validator {
@Override
public boolean isValid(Object value) {
//value must not be null, and if value is a string it cannot be empty
return value != null && (!(value instanceof String) || !((String) value).isEmpty());
}
@Override
public String getValidationMessage(MethodParam param) {
return String.format("%s is required", param.getName());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy