Title: StringValidator Description: Empty validator for generic string values, used when we don't have a decent or practical validation routine
| 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> |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…