@Test public void shouldReturnConfigSourceAsUIByDefault() throws Exception { assertThat(ConfigSource.valueOf(null), IsEqual.equalTo(ConfigSource.UI)); }
public static ConfigSource valueOf(String name) { if (!StringUtils.isNotBlank(name) || name.trim().equalsIgnoreCase(UI.name)) { return UI; } if (FILE.name.equalsIgnoreCase(name.trim())) { return FILE; } throw new MotechConfigurationException("Config source [" + name + "] not supported."); }
ConfigSource { public static ConfigSource valueOf(String name) { if (!StringUtils.isNotBlank(name) || name.trim().equalsIgnoreCase(UI.name)) { return UI; } if (FILE.name.equalsIgnoreCase(name.trim())) { return FILE; } throw new MotechConfigurationException("Config source [" + name + "] not supported."); } }
ConfigSource { public static ConfigSource valueOf(String name) { if (!StringUtils.isNotBlank(name) || name.trim().equalsIgnoreCase(UI.name)) { return UI; } if (FILE.name.equalsIgnoreCase(name.trim())) { return FILE; } throw new MotechConfigurationException("Config source [" + name + "] not supported."); } private  ConfigSource(String name); }
ConfigSource { public static ConfigSource valueOf(String name) { if (!StringUtils.isNotBlank(name) || name.trim().equalsIgnoreCase(UI.name)) { return UI; } if (FILE.name.equalsIgnoreCase(name.trim())) { return FILE; } throw new MotechConfigurationException("Config source [" + name + "] not supported."); } private  ConfigSource(String name); static ConfigSource valueOf(String name); static boolean isValid(String name); @Override String toString(); String getName(); boolean isFile(); }
ConfigSource { public static ConfigSource valueOf(String name) { if (!StringUtils.isNotBlank(name) || name.trim().equalsIgnoreCase(UI.name)) { return UI; } if (FILE.name.equalsIgnoreCase(name.trim())) { return FILE; } throw new MotechConfigurationException("Config source [" + name + "] not supported."); } private  ConfigSource(String name); static ConfigSource valueOf(String name); static boolean isValid(String name); @Override String toString(); String getName(); boolean isFile(); static final ConfigSource FILE; static final ConfigSource UI; }