org.apache.jmeter.testelement.property

## Class AbstractProperty

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

- All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<JMeterProperty>, JMeterProperty
  Direct Known Subclasses:
    BooleanProperty, FunctionProperty, MultiProperty, NullProperty, NumberProperty, ObjectProperty, StringProperty

      public abstract class AbstractProperty
      extends java.lang.Object
      implements JMeterProperty

  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.slf4j.Logger` | `log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractProperty()`
    `AbstractProperty(java.lang.String name)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AbstractProperty` | `clone()`
    `int` | `compareTo(JMeterProperty arg0)` Compares two JMeterProperty object values.
    `protected JMeterProperty` | `convertObject(java.lang.Object item)`
    `static JMeterProperty` | `createProperty(java.lang.Object item)`
    `boolean` | `equals(java.lang.Object o)` Determines if the two objects are equal by comparing names and values
    `protected JMeterProperty` | `getBlankProperty()`
    `protected static JMeterProperty` | `getBlankProperty(java.lang.Object item)`
    `boolean` | `getBooleanValue()` Returns false if string is invalid or null.
    `double` | `getDoubleValue()` Returns 0 if string is invalid or null.
    `float` | `getFloatValue()` Returns 0 if string is invalid or null.
    `int` | `getIntValue()` Returns 0 if string is invalid or null.
    `protected PropertyIterator` | `getIterator(java.util.Collection<JMeterProperty> values)`
    `long` | `getLongValue()` Returns 0 if string is invalid or null.
    `java.lang.String` | `getName()` The name of the property.
    `protected java.lang.Class<? extends JMeterProperty>` | `getPropertyType()` Get the property type for this property.
    `int` | `hashCode()`
    `protected boolean` | `isEqualType(JMeterProperty prop)`
    `boolean` | `isRunningVersion()` Returns whether the property is a running version.
    `protected static JMeterProperty` | `makeProperty(java.lang.Object item)` Create a JMeterProperty from an object.
    `void` | `mergeIn(JMeterProperty prop)` Take the given property object and merge it's value with the current property object.
    `protected java.util.Collection<JMeterProperty>` | `normalizeList(java.util.Collection<?> coll)` Convert a collection of objects into JMeterProperty objects.
    `protected java.util.Map<java.lang.String,JMeterProperty>` | `normalizeMap(java.util.Map<?,?> coll)` Given a Map, it converts the Map into a collection of JMeterProperty objects, appropriate for a MapProperty object.
    `void` | `setName(java.lang.String name)` Set the property name.
    `void` | `setRunningVersion(boolean runningVersion)` Make the property a running version or turn it off as the running version.
    `java.lang.String` | `toString()` Provides the string representation of the property.

    - ### 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, setObjectValue`

- - ### Field Detail

    - #### log

          protected static final org.slf4j.Logger log

  - ### Constructor Detail

    - #### AbstractProperty

          public AbstractProperty(java.lang.String name)

    - #### AbstractProperty

          public AbstractProperty()

  - ### Method Detail

    - #### isEqualType

          protected boolean isEqualType(JMeterProperty prop)

    - #### isRunningVersion

          public boolean isRunningVersion()

      Returns whether the property is a running version.
      Specified by:
        `isRunningVersion` in interface `JMeterProperty`
      Returns:
        flag whether this property is a running version

    - #### getName

          public java.lang.String getName()

      The name of the property. Typically this should match the name that keys the property's location in the test elements Map.
      Specified by:
        `getName` in interface `JMeterProperty`
      Returns:
        the name of the property

    - #### setName

          public void setName(java.lang.String name)

      Set the property name.
      Specified by:
        `setName` in interface `JMeterProperty`
      Parameters:
        `name` - the name of the property

    - #### setRunningVersion

          public void setRunningVersion(boolean runningVersion)

      Make the property a running version or turn it off as the running version. A property that is made a running version will preserve the current state in such a way that it is retrievable by a future call to 'recoverRunningVersion()'. Additionally, a property that is a running version will resolve all functions prior to returning it's property value. A non-running version property will return functions as their uncompiled string representation.
      Specified by:
        `setRunningVersion` in interface `JMeterProperty`
      Parameters:
        `runningVersion` - flag whether this property is a running version

    - #### getIterator

          protected PropertyIterator getIterator(java.util.Collection<JMeterProperty> values)

    - #### clone

          public AbstractProperty clone()

      Specified by:
        `clone` in interface `JMeterProperty`
      Overrides:
        `clone` in class `java.lang.Object`

    - #### getIntValue

          public int getIntValue()

      Returns 0 if string is invalid or null.
      Specified by:
        `getIntValue` in interface `JMeterProperty`
      See Also:
        `JMeterProperty.getIntValue()`

    - #### getLongValue

          public long getLongValue()

      Returns 0 if string is invalid or null.
      Specified by:
        `getLongValue` in interface `JMeterProperty`
      See Also:
        `JMeterProperty.getLongValue()`

    - #### getDoubleValue

          public double getDoubleValue()

      Returns 0 if string is invalid or null.
      Specified by:
        `getDoubleValue` in interface `JMeterProperty`
      See Also:
        `JMeterProperty.getDoubleValue()`

    - #### getFloatValue

          public float getFloatValue()

      Returns 0 if string is invalid or null.
      Specified by:
        `getFloatValue` in interface `JMeterProperty`
      See Also:
        `JMeterProperty.getFloatValue()`

    - #### getBooleanValue

          public boolean getBooleanValue()

      Returns false if string is invalid or null.
      Specified by:
        `getBooleanValue` in interface `JMeterProperty`
      See Also:
        `JMeterProperty.getBooleanValue()`

    - #### equals

          public boolean equals(java.lang.Object o)

      Determines if the two objects are equal by comparing names and values
      Overrides:
        `equals` in class `java.lang.Object`
      Returns:
        true if names are equal and values are equal (or both null)

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### compareTo

          public int compareTo(JMeterProperty arg0)

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

    - #### getPropertyType

          protected java.lang.Class<? extends JMeterProperty> getPropertyType()

      Get the property type for this property. Used to convert raw values into JMeterProperties.
      Returns:
        property type of this property

    - #### getBlankProperty

          protected JMeterProperty getBlankProperty()

    - #### getBlankProperty

          protected static JMeterProperty getBlankProperty(java.lang.Object item)

    - #### normalizeList

          protected java.util.Collection<JMeterProperty> normalizeList(java.util.Collection<?> coll)

      Convert a collection of objects into JMeterProperty objects.
      Parameters:
        `coll` - Collection of any type of object
      Returns:
        Collection of JMeterProperty objects

    - #### normalizeMap

          protected java.util.Map<java.lang.String,JMeterProperty> normalizeMap(java.util.Map<?,?> coll)

      Given a Map, it converts the Map into a collection of JMeterProperty objects, appropriate for a MapProperty object.
      Parameters:
        `coll` - Map to convert
      Returns:
        converted Map

    - #### createProperty

          public static JMeterProperty createProperty(java.lang.Object item)

    - #### makeProperty

          protected static JMeterProperty makeProperty(java.lang.Object item)

      Create a JMeterProperty from an object. The object can be one of:
      - JMeterProperty - returned unchanged
      - TestElement => TestElementProperty with the same name
      - Map|Collection => Map|CollectionProperty with the name = item.hashCode
      Parameters:
        `item` - object to be turned into a property
      Returns:
        the JMeterProperty

    - #### convertObject

          protected JMeterProperty convertObject(java.lang.Object item)

    - #### toString

          public java.lang.String toString()

      Provides the string representation of the property.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        the string value

    - #### mergeIn

          public void mergeIn(JMeterProperty prop)

      Take the given property object and merge it's value with the current property object. For most property types, this will simply be ignored. But for collection properties and test element properties, more complex behavior is required.
      Specified by:
        `mergeIn` in interface `JMeterProperty`
      Parameters:
        `prop` - the property object to merge into this property

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