# copy method

PropertyValue copy()

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

    PropertyValue copy() {
      final rawValue = getValue();
      final pv = PropertyValue(
        _name,
        rawValue is MutablePropertyValues ? rawValue : getValue(),
        qualifiedName: getQualifiedName(),
        packageName: getPackageName(),
      );

      pv._optional = _optional;
      if (_converted) {
        pv.setConvertedValue(_convertedValue);
      }

      return pv;
    }