static <T extends DroneConfiguration<T>> Field injectField(T configuration, List<Field> maps, Map<String, Field> fields, String fieldName, String value) { try { Field f = fields.get(fieldName); if (f.getAnnotation(Deprecated.class) != null) { log.log(Level.WARNING, "The property \"{0}\" used in Arquillian \"{1}\" configuration is deprecated.", new Object[] {f.getName(), configuration.getConfigurationName()}); } // remap the property into capability if this is a legacy one // or remap the property into different property field if (LegacyConfigurationMapper.isLegacy(fieldName)) { String newKey = LegacyConfigurationMapper.remapKey(fieldName); String newValue = LegacyConfigurationMapper.remapValue(fieldName, value); if (LegacyConfigurationMapper.remapsToCapability(fieldName)) { injectMapProperty(configuration, maps, fields, newKey, newValue); } else { injectField(configuration, maps, fields, newKey, newValue); } } f.set(configuration, convert(f.getType(), value)); return f; } catch (Exception e) { throw new RuntimeException( "Could not map Drone configuration(" + configuration.getConfigurationName() + ") for " + configuration.getClass().getName() + " from Arquillian Descriptor", e); } }
static <T extends DroneConfiguration<T>> Field injectField(T configuration, List<Field> maps, Map<String, Field> fields, String fieldName, String value) { try { Field f = fields.get(fieldName); if (f.getAnnotation(Deprecated.class) != null) { log.log(Level.WARNING, "The property \"{0}\" used in Arquillian \"{1}\" configuration is deprecated.", new Object[] {f.getName(), configuration.getConfigurationName()}); } // remap the property into capability if this is a legacy one // or remap the property into different property field if (LegacyConfigurationMapper.isLegacy(fieldName)) { String newKey = LegacyConfigurationMapper.remapKey(fieldName); String newValue = LegacyConfigurationMapper.remapValue(fieldName, value); if (LegacyConfigurationMapper.remapsToCapability(fieldName)) { injectMapProperty(configuration, maps, fields, newKey, newValue); } else { injectField(configuration, maps, fields, newKey, newValue); } } f.set(configuration, convert(f.getType(), value)); return f; } catch (Exception e) { throw new RuntimeException( "Could not map Drone configuration(" + configuration.getConfigurationName() + ") for " + configuration.getClass().getName() + " from Arquillian Descriptor", e); } }