if (item.getDefaultValue() != null) { return false; if (!defaultValue.equals(item.getDefaultValue())) { return false; if (!defaultValue.equals(String.valueOf(item.getDefaultValue()))) { return false; if (!defaultValue.equals(String.valueOf(item.getDefaultValue()))) { return false; if (!defaultValue.equals(join((String[]) item.getDefaultValue(), ARRAY_SEPARATOR))) { return false;
if (item.getDefaultValue() != null) { return false; if (!defaultValue.equals(item.getDefaultValue())) { return false; if (!defaultValue.equals(String.valueOf(item.getDefaultValue()))) { return false; if (!defaultValue.equals(String.valueOf(item.getDefaultValue()))) { return false; if (!defaultValue.equals(join((String[]) item.getDefaultValue(), ARRAY_SEPARATOR))) { return false;
public ConfigItem registerConfigItem(ConfigItem configItem) { if (configItem == null) { throw new IllegalArgumentException("configItem must be set"); } ConfigItemImpl ci = null; if (StringUtils.isNotBlank(configItem.getName())) { ci = new ConfigItemImpl(configItem.getName(), configItem.getValue(), configItem.getSource()); if (configItem.getValue() != null) { ci.setValue(configItem.getValue()); } if (configItem.getDefaultValue() != null) { ci.setDefaultValue(configItem.getDefaultValue()); } ci = this.addConfigItem(ci, ci.getSource()); } else { log.warn("Skipping registering invalid config item (name not set): "+configItem); } return ci; }
if (item.getDefaultValue() != null) { hItem.setDefaultValue(serializeValue(item.getDefaultValue(), item.getType(), item.isSecured())); } else if (!defaultValue.equals(item.getDefaultValue())) { hItem.setDefaultValue(serializeValue(item.getDefaultValue(), item.getType(), item.isSecured()));
serialDefaultValue = serializeValue(item.getDefaultValue(), item.getType(), item.isSecured()); serialRawValue = serializeValue(getRawProperty(item.getName()), ServerConfigurationService.TYPE_STRING, item.isSecured()); } catch (IllegalClassException ice) {
/** * merges the contents of one config item (the safely changed fields) into this one * @param ci any config item */ public void merge(ConfigItem ci) { if (ci != null) { //this.name = name; this.value = ci.getValue(); this.type = setValue(ci.getValue()); this.description = ci.getDescription(); if (StringUtils.isNotBlank(ci.getSource())) { this.source = ci.getSource(); } this.defaultValue = ci.getDefaultValue(); this.dynamic = ci.isDynamic(); } }
/** * Make an impl from something that implements ConfigItem by copying the field values * @param ci a ci object */ @SuppressWarnings("unused") public ConfigItemImpl(ConfigItem ci) { this(ci.getName(), ci.getValue(), ci.getType(), ci.getDescription(), ci.getSource(), ci.getDefaultValue(), ci.getRequested(), ci.getChanged(), null, ci.isRegistered(), ci.isDefaulted(), ci.isSecured(), ci.isDynamic()); if (ci.getHistory() != null) { this.history = Arrays.asList(ci.getHistory()); } else { this.history = new ArrayList<ConfigHistory>(); } }