Class PropertyValueSerializer
java.lang.Object
com.pulumi.provider.internal.properties.PropertyValueSerializer
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 Summary
Modifier and TypeMethodDescriptionstatic <T> Tdeserialize(PropertyValue value, Class<T> targetType) Deserializes a PropertyValue into the specified target type.static Map<String,PropertyValue> stateFromComponentResource(Object component) Converts a component resource object into a map of property values.static CompletableFuture<Map<String,PropertyValue>> stateFromComponentResourceAsync(Object component) Converts a component resource object into a map of property values asynchronously.
-
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 deserializetargetType- the Class to deserialize into- Returns:
- the deserialized object of type T
- Throws:
PropertyDeserializationException- if the value cannot be deserialized to the target typeIllegalArgumentException- 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 theExportannotation and serializes their values intoPropertyValueobjects.- Parameters:
component- The component resource object to convert- Returns:
- A map where keys are property names and values are serialized
PropertyValueobjects - Throws:
PropertySerializationException- if there is an error accessing field values
-
stateFromComponentResource
Converts a component resource object into a map of property values. This method examines the fields of the component resource marked with theExportannotation and serializes their values intoPropertyValueobjects.- Parameters:
component- The component resource object to convert- Returns:
- A map where keys are property names and values are serialized
PropertyValueobjects - Throws:
PropertySerializationException- if there is an error accessing field values
-