Beispiel #1
0
 @Override
 public <E> E get(Class<E> type, String attrName) {
   JsonNode json = data.get(attrName);
   if (json == null) {
     throw new ConfigException("Attribute " + attrName + " is required but not set");
   }
   return model.readObject(type, json.traverse());
 }
Beispiel #2
0
 @Override
 public <E> E get(Class<E> type, String attrName, E defaultValue) {
   JsonNode json = data.get(attrName);
   if (json == null) {
     return defaultValue;
   }
   return model.readObject(type, json.traverse());
 }
Beispiel #3
0
 @Override
 public <T> T loadTask(Class<T> taskType) {
   return model.readObject(taskType, data.traverse());
 }