/** * Create a String property - but only if it is not the default. * This is intended for use when adding new properties to JMeter * so that JMX files are not expanded unnecessarily. * * N.B. - must agree with the default applied when reading the property. * * @param name property name * @param value current value * @param dflt default */ @Override public void setProperty(String name, String value, String dflt) { if (dflt.equals(value)) { removeProperty(name); } else { setProperty(new StringProperty(name, value)); } }
/** * Create a boolean property - but only if it is not the default. * This is intended for use when adding new properties to JMeter * so that JMX files are not expanded unnecessarily. * * N.B. - must agree with the default applied when reading the property. * * @param name property name * @param value current value * @param dflt default */ @Override public void setProperty(String name, boolean value, boolean dflt) { if (value == dflt) { removeProperty(name); } else { setProperty(new BooleanProperty(name, value)); } }
/** * Create a long property - but only if it is not the default. * This is intended for use when adding new properties to JMeter * so that JMX files are not expanded unnecessarily. * * N.B. - must agree with the default applied when reading the property. * * @param name property name * @param value current value * @param dflt default */ @Override public void setProperty(String name, long value, long dflt) { if (value == dflt) { removeProperty(name); } else { setProperty(new LongProperty(name, value)); } }
/** * Create an int property - but only if it is not the default. * This is intended for use when adding new properties to JMeter * so that JMX files are not expanded unnecessarily. * * N.B. - must agree with the default applied when reading the property. * * @param name property name * @param value current value * @param dflt default */ @Override public void setProperty(String name, int value, int dflt) { if (value == dflt) { removeProperty(name); } else { setProperty(new IntegerProperty(name, value)); } }