MCPcopy Index your code
hub / github.com/OpenTSDB/opentsdb / StringValidator

Class StringValidator

src/tools/ConfigMetaType.java:266–287  ·  view source on GitHub ↗

Title: StringValidator Description: Empty validator for generic string values, used when we don't have a decent or practical validation routine

Source from the content-addressed store, hash-verified

264 * <p>Description: Empty validator for generic string values, used when we don't have a decent or practical validation routine</p>
265 */
266 public static class StringValidator implements ArgValueValidator {
267 /** Informational name */
268 protected final String name;
269
270 /**
271 * Creates a new StringValidator
272 * @param name The name of the type
273 */
274 public StringValidator(String name) {
275 this.name = name;
276 }
277 /**
278 * {@inheritDoc}
279 * @see net.opentsdb.tools.ArgValueValidator#validate(net.opentsdb.tools.ConfigArgP.ConfigurationItem)
280 */
281 @Override
282 public void validate(final ConfigurationItem citem) {
283 if(citem.getValue()==null || citem.getValue().trim().isEmpty()) {
284 throw new IllegalArgumentException("Null or empty " + name + " value for " + citem.getName());
285 }
286 }
287 }
288
289 /**
290 * <p>Title: BootLoadableClassValidator</p>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…