org.apache.jmeter.testelement.property

## Class NumberProperty

- java.lang.Object
- - org.apache.jmeter.testelement.property.AbstractProperty
  - - org.apache.jmeter.testelement.property.NumberProperty

- All Implemented Interfaces:
    Serializable, Cloneable, Comparable<JMeterProperty>, JMeterProperty
  Direct Known Subclasses:
    DoubleProperty, FloatProperty, IntegerProperty, LongProperty

      public abstract class NumberProperty
      extends AbstractProperty

  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class org.apache.jmeter.testelement.property.AbstractProperty

      `log`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `NumberProperty()`
    `protected` | `NumberProperty(String name)`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(JMeterProperty arg0)` Compares two JMeterProperty object values.
    `protected abstract void` | `setNumberValue(Number n)` Set the value of the property with a Number object.
    `protected abstract void` | `setNumberValue(String n)` Set the value of the property with a String object.
    `void` | `setObjectValue(Object v)`

    - ### Methods inherited from class org.apache.jmeter.testelement.property.AbstractProperty

      `clone, convertObject, createProperty, equals, getBlankProperty, getBlankProperty, getBooleanValue, getDoubleValue, getFloatValue, getIntValue, getIterator, getLongValue, getName, getPropertyType, hashCode, isEqualType, isRunningVersion, makeProperty, mergeIn, normalizeList, normalizeMap, setName, setRunningVersion, toString`

    - ### Methods inherited from class java.lang.Object

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.apache.jmeter.testelement.property.JMeterProperty

      `getObjectValue, getStringValue, recoverRunningVersion`

- - ### Constructor Detail

    - #### NumberProperty

          protected NumberProperty()

    - #### NumberProperty

          protected NumberProperty(String name)

  - ### Method Detail

    - #### setNumberValue

          protected abstract void setNumberValue(Number n)

      Set the value of the property with a Number object.
      Parameters:
        `n` - the value to set

    - #### setNumberValue

          protected abstract void setNumberValue(String n)
                                          throws NumberFormatException

      Set the value of the property with a String object.
      Parameters:
        `n` - the number to set as a string representation
      Throws:
        `NumberFormatException` - if the number `n` can not be converted to a `Number`

    - #### setObjectValue

          public void setObjectValue(Object v)

    - #### compareTo

          public int compareTo(JMeterProperty arg0)

      Description copied from class: `AbstractProperty`
      Compares two JMeterProperty object values. N.B. Does not compare names
      Specified by:
        `compareTo` in interface `Comparable<JMeterProperty>`
      Overrides:
        `compareTo` in class `AbstractProperty`
      Parameters:
        `arg0` - JMeterProperty to compare against
      Returns:
        0 if equal values or both values null; -1 otherwise
      See Also:
        `Comparable.compareTo(Object)`

Copyright © 1998-2021 Apache Software Foundation. All Rights Reserved.