1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-13 01:36:18 +00:00

Tag colors (client)

This commit is contained in:
jendib
2013-08-08 01:38:30 +02:00
parent b2ab313d11
commit 6c347ff826
20 changed files with 802 additions and 27 deletions

View File

@@ -63,7 +63,7 @@ public class ValidationUtil {
throw new ClientException("ValidationError", MessageFormat.format("{0} must be more than {1} characters", name, lengthMin));
}
if (lengthMax != null && s.length() > lengthMax) {
throw new ClientException("ValidationError", MessageFormat.format("{0} must be more than {1} characters", name, lengthMax));
throw new ClientException("ValidationError", MessageFormat.format("{0} must be less than {1} characters", name, lengthMax));
}
return s;
}
@@ -94,6 +94,19 @@ public class ValidationUtil {
return validateLength(s, name, 1, null, false);
}
/**
* Checks if the string is a hexadecimal color.
*
* @param s String to validate
* @param name Name of the parameter
* @param nullable True if the string can be empty or null
* @throws JSONException
*/
public static void validateHexColor(String s, String name, boolean nullable) throws JSONException {
// TODO Do a real check
ValidationUtil.validateLength(s, "name", 7, 7, nullable);
}
/**
* Checks if the string is an email.
*