2015-05-28 13:19:25 +02:00
|
|
|
package org.gcube.accounting.datamodel.validators;
|
|
|
|
|
|
|
|
import org.gcube.common.validator.annotations.FieldValidator;
|
|
|
|
|
2015-06-03 11:57:38 +02:00
|
|
|
public class ValidLongValidator implements FieldValidator<ValidLong>{
|
2015-05-28 13:19:25 +02:00
|
|
|
|
2015-06-03 11:57:38 +02:00
|
|
|
public Class<ValidLong> annotation() {
|
|
|
|
return ValidLong.class;
|
2015-05-28 13:19:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public boolean isValid(Object toValidate) {
|
|
|
|
if(toValidate instanceof Long){
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getErrorSuffix() {
|
2015-06-03 11:57:38 +02:00
|
|
|
return String.format("not instace of %s", Long.class.getSimpleName());
|
2015-05-28 13:19:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|