# PropertyValue.copy constructor

PropertyValue.copy(

1. PropertyValue pv

)

Creates a deep copy of this PropertyValue.

The copy includes the original value, converted value (if any), conversion state, and the optional flag.

Returns a new PropertyValue instance with the same state.

Example:

    final pv = PropertyValue('enabled', 'true');
    pv.setConvertedValue(true);
    final copy = pv.copy();
    print(copy.convertedValue); // true
    print(copy.optional); // false (default)

## Implementation

    factory PropertyValue.copy(PropertyValue pv) {
      final res = PropertyValue(pv._name, pv.getValue(), qualifiedName: pv.getQualifiedName(), packageName: pv.getPackageName());
      res._optional = pv._optional;
      if (pv._converted) {
        res.setConvertedValue(pv._convertedValue);
      }
      return res;
    }