/** * Sets the value of this property to the <code>toString</code> form of the given <code>value</code>. This object * will not hold a reference to the <code>value</code>. * * <p>Calling this method is the same as if calling {@link #setValue(Object)}.</p> * * @param value */ public void setDoubleValue(@Nullable Double value) { this.setValue(value); }
/** * Sets the value of this property to the <code>toString</code> form of the given <code>value</code>. This object * will not hold a reference to the <code>value</code>. * * <p>Calling this method is the same as if calling {@link #setValue(Object)}.</p> * * @param value */ public void setBooleanValue(@Nullable Boolean value) { this.setValue(value); }
/** * Sets the value of this property to the given <code>value</code>. * * <p>Calling this method is the same as if calling {@link #setValue(Object)}.</p> * * @param value */ public void setStringValue(@Nullable String value) { this.setValue(value); }
/** * Sets the value of this property to the <code>toString</code> form of the given <code>value</code>. This object * will not hold a reference to the <code>value</code>. * * <p>Calling this method is the same as if calling {@link #setValue(Object)}.</p> * * @param value */ public void setLongValue(@Nullable Long value) { this.setValue(value); }
/** * Sets the value of this property to the <code>toString</code> form of the given <code>value</code>. This object * will not hold a reference to the <code>value</code>. * * <p>Calling this method is the same as if calling {@link #setValue(Object)}.</p> * * @param value */ public void setIntegerValue(@Nullable Integer value) { this.setValue(value); }
/** * Sets the value of this property to the <code>toString</code> form of the given <code>value</code>. This object * will not hold a reference to the <code>value</code>. * * <p>Calling this method is the same as if calling {@link #setValue(Object)}.</p> * * @param value */ public void setFloatValue(@Nullable Float value) { this.setValue(value); }
/** * Constructs a property that has the given name with the given value. The value's <code>toString</code> * representation will be stored in this object - <code>value</code> itself will not be stored (that is, this object * will not hold a reference to <code>value</code>). * * @param name * @param value */ public PropertySimple(@NotNull String name, @Nullable Object value) { setName(name); setValue(value); }
/** * Sets the value of this property. You should pass the "clear text" value - the obfuscation of * the value in the database is done for you behind the scenes. */ @Override public void setValue(Object value) { //just use the logic in the superclass to set the value super.setValue(value); //and obtain the result this.clearTextValue = super.getStringValue(); //now set the underlying value to the obfuscated one super.setValue(obfuscate(clearTextValue)); //now we have the clear text string representation of the value in "clearTextValue", //the stringValue in the superclass contains the corresponding obfuscated string. }
public void setStartScript(File startScript) { PropertySimple prop = this.pluginConfig.getSimple(START_SCRIPT_PROP); if (prop == null) { prop = new PropertySimple(START_SCRIPT_PROP, null); this.pluginConfig.put(prop); } prop.setValue(startScript); }
/** * Persist a single property of a given configuration. If the property does not yet exist, * it is created otherwise overwritten with the new value. * @param config configuration the property is on * @param propertyName name of the property to persist * @param value (new) value of the property to persist * @return the updated configuration */ protected Configuration persistProperty(Configuration config, String propertyName, Object value) { PropertySimple prop = config.getSimple(propertyName); if (prop == null) { prop = new PropertySimple(propertyName, value); config.put(prop); } else { prop.setValue(value); } Configuration ret = persistConfiguration(config); return ret; }
@Override public void updateResourceConfiguration(ConfigurationUpdateReport report) { Configuration config = report.getConfiguration(); boolean isWildcard = false; // detect if any of wildcard properties was turned on for (String wildcard : wildCards) { isWildcard |= Boolean.valueOf(config.getSimpleValue(wildcard)); } if (config.getSimpleValue("inet-address") != null) { if (isWildcard) { // we couldn't know what user wants ... if setting inet-addr or one of wildcard props report .setErrorMessage("When setting any-address or any-ipv4-address or any-ipv6-address to true inet-address must be unset"); report.setStatus(ConfigurationUpdateStatus.FAILURE); return; } // auto-set all wildcards to undefined for (String wildcard : wildCards) { config.getSimple(wildcard).setValue(null); } } else if (!isWildcard) { report .setErrorMessage("You need to enable either any-address or any-ipv4-address or any-ipv6-address when inet-address is disabled"); report.setStatus(ConfigurationUpdateStatus.FAILURE); return; } super.updateResourceConfiguration(report); }