static <T extends DroneConfiguration<T>> void injectMapProperty(T configuration, List<Field> maps, Map<String, Field> fields, String propertyName, String value) { try { for (Field mapField : maps) { Object typedValue = value; if (CapabilityTypeMapper.isCastNeeded(propertyName)) { typedValue = CapabilityTypeMapper.createTypedObjectFromString(propertyName, value); } // put property into a map @SuppressWarnings("unchecked") Map<String, Object> map = (Map<String, Object>) mapField.get(configuration); map.put(propertyName, typedValue); } } 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>> void injectMapProperty(T configuration, List<Field> maps, Map<String, Field> fields, String propertyName, String value) { try { for (Field mapField : maps) { Object typedValue = value; if (CapabilityTypeMapper.isCastNeeded(propertyName)) { typedValue = CapabilityTypeMapper.createTypedObjectFromString(propertyName, value); } // put property into a map @SuppressWarnings("unchecked") Map<String, Object> map = (Map<String, Object>) mapField.get(configuration); map.put(propertyName, typedValue); } } catch (Exception e) { throw new RuntimeException( "Could not map Drone configuration(" + configuration.getConfigurationName() + ") for " + configuration.getClass().getName() + " from Arquillian Descriptor", e); } }