/** @return */ public String getBehavior() { if (properties.getProperty("behavior") != null) { return properties.getProperty("behavior"); } else { LOG.warning("Undefined property 'behavior' in command '" + this.getName() + "'"); return "undefined-behavior"; } }
public void executeSetScreenMode(Config params) { boolean executed = executeCommand("set screenmode", params); if (executed) { setScreenMode(params.getProperty("value")); setChanged(true); } }
public void executeSetAVSelection(Config params) { boolean executed = executeCommand("set avselection", params); if (executed) { setAVSelection(params.getProperty("value")); setChanged(true); } }
public void executeSetInput(Config params) { boolean executed = executeCommand("set input", params); if (executed) { setInput(params.getProperty("value")); setChanged(true); } }
public void destroy() { name = null; receiver = null; description = null; stopIf = null; properties.getProperties().clear(); properties = null; }
/** * Creates an oredred list reading the command properties writed in format * "parameter[AN_INT_FROM_0_TO_999]" other properties format are ignored (not added to the * returned List) The indexs must be contiguous (1,2,3,...) for example: * * <p> * <li>parameter[0] = foo * <li> * <li>parameter[1] = bar * <li>parameter[3] = asd * <li>object = Light 1 * <li>another-param = myValue * * <p>The returned ArrayList<String> is * <li>[0]->foo * <li>[1]->bar because the index = 2 is missing. * * @return an ordered ArrayList<String> of command parameter values */ public ArrayList<String> getParametersAsList() { ArrayList<String> output = new ArrayList<String>(); // 99 is the max num of elements in list for (int i = 0; i < 99; i++) { String value = null; value = properties.getProperties().getProperty("parameter[" + i + "]"); if (value != null) { // add to array output.add(value); } else { // if the elements are not contiguous return return output; } } return output; }
/** * @param key * @param value */ public void setProperty(String key, String value) { if (!key.isEmpty()) { properties.setProperty(key, value); } }
/** * @param key * @return */ public String getProperty(String key) { return properties.getProperty(key); }