@Test public void testFromConfigWithClass() { List<MConfig> configs = getConfigs(); ((MStringInput) configs.get(0).getInputs().get(0)).setValue("value"); TestConfiguration config = (TestConfiguration) ConfigUtils.fromConfigs(configs, TestConfiguration.class); AssertJUnit.assertEquals("value", config.aConfig.a1); }
public static Object fromConfigs(List<MConfig> configs, Class configClass) { Object configInstance = ClassUtils.instantiate(configClass); if(configInstance == null) { throw new SqoopException(ModelError.MODEL_016, configClass.getCanonicalName()); } fromConfigs(configs, configInstance); return configInstance; }
ConfigUtils { public static Object fromConfigs(List<MConfig> configs, Class configClass) { Object configInstance = ClassUtils.instantiate(configClass); if(configInstance == null) { throw new SqoopException(ModelError.MODEL_016, configClass.getCanonicalName()); } fromConfigs(configs, configInstance); return configInstance; } }
ConfigUtils { public static Object fromConfigs(List<MConfig> configs, Class configClass) { Object configInstance = ClassUtils.instantiate(configClass); if(configInstance == null) { throw new SqoopException(ModelError.MODEL_016, configClass.getCanonicalName()); } fromConfigs(configs, configInstance); return configInstance; }  }
ConfigUtils { public static Object fromConfigs(List<MConfig> configs, Class configClass) { Object configInstance = ClassUtils.instantiate(configClass); if(configInstance == null) { throw new SqoopException(ModelError.MODEL_016, configClass.getCanonicalName()); } fromConfigs(configs, configInstance); return configInstance; }  static List<MConfig> toConfigs(Object configuration); static List<MConfig> toConfigs(Class<?> klass); static List<MConfig> toConfigs(Class<?> klass, Object configuration); static ConfigValidationResult validateConfigs(List<MConfig> configs, Class configClass); static Object fromConfigs(List<MConfig> configs, Class configClass); @SuppressWarnings("unchecked") static void fromConfigs(List<MConfig> configs, Object configuration); static void applyValidation(List<MConfig> configs, ConfigValidationResult result); static void applyValidation(MValidatedElement element, ConfigValidationResult result); @SuppressWarnings("unchecked") static String toJson(Object configuration); @SuppressWarnings("unchecked") static void fillValues(String json, Object configuration); static String getName(Field input, Input annotation); static String getName(Field config, Config annotation); static ConfigurationClass getConfigurationClassAnnotation(Object object, boolean strict); static ConfigClass getConfigClassAnnotation(Object object, boolean strict); static Config getConfigAnnotation(Field field, boolean strict); static Input getInputAnnotation(Field field, boolean strict); static Object getFieldValue(Field field, Object object); static void validateInputOverridesAttribute(MInput<?> currentInput, MConfig config); }
ConfigUtils { public static Object fromConfigs(List<MConfig> configs, Class configClass) { Object configInstance = ClassUtils.instantiate(configClass); if(configInstance == null) { throw new SqoopException(ModelError.MODEL_016, configClass.getCanonicalName()); } fromConfigs(configs, configInstance); return configInstance; }  static List<MConfig> toConfigs(Object configuration); static List<MConfig> toConfigs(Class<?> klass); static List<MConfig> toConfigs(Class<?> klass, Object configuration); static ConfigValidationResult validateConfigs(List<MConfig> configs, Class configClass); static Object fromConfigs(List<MConfig> configs, Class configClass); @SuppressWarnings("unchecked") static void fromConfigs(List<MConfig> configs, Object configuration); static void applyValidation(List<MConfig> configs, ConfigValidationResult result); static void applyValidation(MValidatedElement element, ConfigValidationResult result); @SuppressWarnings("unchecked") static String toJson(Object configuration); @SuppressWarnings("unchecked") static void fillValues(String json, Object configuration); static String getName(Field input, Input annotation); static String getName(Field config, Config annotation); static ConfigurationClass getConfigurationClassAnnotation(Object object, boolean strict); static ConfigClass getConfigClassAnnotation(Object object, boolean strict); static Config getConfigAnnotation(Field field, boolean strict); static Input getInputAnnotation(Field field, boolean strict); static Object getFieldValue(Field field, Object object); static void validateInputOverridesAttribute(MInput<?> currentInput, MConfig config);  }