validation method added

This commit is contained in:
Gavriil Sitnikov 2016-05-16 13:05:45 +03:00
parent f0c6e91309
commit f06a3dca7e
1 changed files with 6 additions and 0 deletions

View File

@ -33,4 +33,10 @@ public abstract class GoogleJsonModel extends Model {
}
}
protected static void validateNullOrNonEmpty(@Nullable final Object object) throws ValidationException {
if (object != null && isNullOrEmpty(object)) {
throw new ValidationException("Nullable or not empty object is empty");
}
}
}