Class PropertyValueSerializer
- java.lang.Object
-
- com.pulumi.provider.internal.properties.PropertyValueSerializer
-
public final class PropertyValueSerializer extends java.lang.ObjectA utility class for deserializingPropertyValueobjects into Java types. This class handles deserialization of primitive types, collections, maps, and complex objects with support for Pulumi'sOutputtypes and annotations.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> Tdeserialize(PropertyValue value, java.lang.Class<T> targetType)Deserializes a PropertyValue into the specified target type.static java.util.Map<java.lang.String,PropertyValue>stateFromComponentResource(java.lang.Object component)Converts a component resource object into a map of property values.static java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,PropertyValue>>stateFromComponentResourceAsync(java.lang.Object component)Converts a component resource object into a map of property values asynchronously.
-
-
-
Method Detail
-
deserialize
public static <T> T deserialize(PropertyValue value, java.lang.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 typejava.lang.IllegalArgumentException- if value or targetType is null
-
stateFromComponentResourceAsync
public static java.util.concurrent.CompletableFuture<java.util.Map<java.lang.String,PropertyValue>> stateFromComponentResourceAsync(java.lang.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
public static java.util.Map<java.lang.String,PropertyValue> stateFromComponentResource(java.lang.Object component)
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
-
-