Class PropertyValueSerializer

java.lang.Object
com.pulumi.provider.internal.properties.PropertyValueSerializer

public final class PropertyValueSerializer extends Object
A utility class for deserializing PropertyValue objects into Java types. This class handles deserialization of primitive types, collections, maps, and complex objects with support for Pulumi's Output types and annotations.
  • Method Details

    • deserialize

      public static <T> T deserialize(PropertyValue value, Class<T> targetType) throws PropertyDeserializationException
      Deserializes a PropertyValue into the specified target type.
      Type Parameters:
      T - the type to deserialize to
      Parameters:
      value - the PropertyValue to deserialize
      targetType - the Class to deserialize into
      Returns:
      the deserialized object of type T
      Throws:
      PropertyDeserializationException - if the value cannot be deserialized to the target type
      IllegalArgumentException - if value or targetType is null
    • stateFromComponentResourceAsync

      public static CompletableFuture<Map<String,PropertyValue>> stateFromComponentResourceAsync(Object component)
      Converts a component resource object into a map of property values asynchronously. This method examines the fields of the component resource marked with the Export annotation and serializes their values into PropertyValue objects.
      Parameters:
      component - The component resource object to convert
      Returns:
      A map where keys are property names and values are serialized PropertyValue objects
      Throws:
      PropertySerializationException - if there is an error accessing field values
    • stateFromComponentResource

      public static Map<String,PropertyValue> stateFromComponentResource(Object component)
      Converts a component resource object into a map of property values. This method examines the fields of the component resource marked with the Export annotation and serializes their values into PropertyValue objects.
      Parameters:
      component - The component resource object to convert
      Returns:
      A map where keys are property names and values are serialized PropertyValue objects
      Throws:
      PropertySerializationException - if there is an error accessing field values