24 lines
546 B
Java
24 lines
546 B
Java
package org.gcube.accounting.datamodel.validators;
|
|
|
|
import org.gcube.accounting.datamodel.UsageRecord;
|
|
import org.gcube.common.validator.annotations.FieldValidator;
|
|
|
|
public class ValidTimeValidator implements FieldValidator<ValidTime>{
|
|
|
|
public Class<ValidTime> annotation() {
|
|
return ValidTime.class;
|
|
}
|
|
|
|
public boolean isValid(Object toValidate) {
|
|
if(toValidate instanceof Long){
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public String getErrorSuffix() {
|
|
return String.format("not instace of %s", UsageRecord.class.getSimpleName());
|
|
}
|
|
|
|
}
|