@Test(dataProvider = "setVariable") public void testSetVariable(String first, String second, boolean expected) { ConfigurationSection section; section = new ConfigurationSection(); assert section.setVariable("var", first); assertVariable(section, "var", first); assert expected == section.setVariable("var", second); assertVariable(section, "var", second); }
public boolean setVariable(String name, String value) { if(value == null || value.trim().equals("")) { if(getVariable(name) == null) return false; removeVariable(name); return true; } String buffer; buffer = variables.put(name, value); return buffer == null || !buffer.equals(value); }
ConfigurationSection { public boolean setVariable(String name, String value) { if(value == null || value.trim().equals("")) { if(getVariable(name) == null) return false; removeVariable(name); return true; } String buffer; buffer = variables.put(name, value); return buffer == null || !buffer.equals(value); } }
ConfigurationSection { public boolean setVariable(String name, String value) { if(value == null || value.trim().equals("")) { if(getVariable(name) == null) return false; removeVariable(name); return true; } String buffer; buffer = variables.put(name, value); return buffer == null || !buffer.equals(value); } ConfigurationSection(); }
ConfigurationSection { public boolean setVariable(String name, String value) { if(value == null || value.trim().equals("")) { if(getVariable(name) == null) return false; removeVariable(name); return true; } String buffer; buffer = variables.put(name, value); return buffer == null || !buffer.equals(value); } ConfigurationSection(); String removeVariable(String name); String getVariable(String name); boolean setVariable(String name, String value); Iterator<String> variableNames(); boolean hasVariables(); static int getIntegerValue(String value); static ValueList getListValue(String value, String separator); static float getFloatValue(String value); static boolean getBooleanValue(String value); static long getLongValue(String value); static double getDoubleValue(String value); static String getValue(int value); static String getValue(List<String> value, String separator); static String getValue(float value); static String getValue(boolean value); static String getValue(long value); static String getValue(double value); ConfigurationSection addSection(String name); ConfigurationSection removeSection(String name); boolean removeSection(ConfigurationSection section); ConfigurationSection getSection(String name); Iterator<String> sectionNames(); boolean hasSections(); boolean isEmpty(); void clear(); }
ConfigurationSection { public boolean setVariable(String name, String value) { if(value == null || value.trim().equals("")) { if(getVariable(name) == null) return false; removeVariable(name); return true; } String buffer; buffer = variables.put(name, value); return buffer == null || !buffer.equals(value); } ConfigurationSection(); String removeVariable(String name); String getVariable(String name); boolean setVariable(String name, String value); Iterator<String> variableNames(); boolean hasVariables(); static int getIntegerValue(String value); static ValueList getListValue(String value, String separator); static float getFloatValue(String value); static boolean getBooleanValue(String value); static long getLongValue(String value); static double getDoubleValue(String value); static String getValue(int value); static String getValue(List<String> value, String separator); static String getValue(float value); static String getValue(boolean value); static String getValue(long value); static String getValue(double value); ConfigurationSection addSection(String name); ConfigurationSection removeSection(String name); boolean removeSection(ConfigurationSection section); ConfigurationSection getSection(String name); Iterator<String> sectionNames(); boolean hasSections(); boolean isEmpty(); void clear();  }