# applyPropertyValues method

1. @protected

void applyPropertyValues(

1. String podName,
2. RootPodDefinition root,
3. PodHolder ph,
4. MutablePropertyValues pvs,

)

Applies property values to the pod instance.

This method converts values to the appropriate types and sets them on the pod instance using reflection.

@param podName The name of the pod @param root The pod definition @param ph The pod holder @param pvs The property values to apply

## Implementation

    @protected
    void applyPropertyValues(String podName, RootPodDefinition root, PodHolder ph, MutablePropertyValues pvs) {
      if (pvs.isEmpty) {
        return;
      }

      try {
        List<PropertyValue> resolvedValues = [];

        for (PropertyValue pv in pvs.getPropertyValues()) {
          Object? resolvedValue = pv.getValue();

          PropertyValue resolvedPv = pv;
          if (pv.isConverted()) {
            resolvedPv.setConvertedValue(resolvedValue);
          }
          resolvedValues.add(resolvedPv);
        }

        // Apply resolved property values to the pod instance
        for (PropertyValue pv in resolvedValues) {
          try {
            setPropertyValue(ph, pv);
          } on PodCreationException catch (e) {
            if(logger.getIsTraceEnabled()) {
              logger.trace("Failed to set property '${pv.getName()}' on pod '$podName' while creating pod: $e");
            }

            rethrow;
          } catch (e) {
            if(logger.getIsTraceEnabled()) {
              logger.trace("Failed to set property '${pv.getName()}' on pod '$podName': $e");
            }

            throw PodCreationException.withResource(
              root.description,
              podName,
              "Failed to set property '${pv.getName()}': $e",
              cause: e is Throwable ? e : RuntimeException(e.toString())
            );
          }
        }
      } on PodCreationException catch (_) {
        rethrow;
      } catch (e) {
        throw PodCreationException.withResource(
          root.description,
          podName,
          "Error setting property values: $e",
          cause: e is Throwable ? e : RuntimeException(e.toString())
        );
      }
    }