Class PropertyValueSerializer


  • public final class PropertyValueSerializer
    extends java.lang.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 Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T deserialize​(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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 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
        java.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 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 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 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