Interface WXMSerializerProviderType<T>

Type Parameters:
T - The type of serialized values
All Known Subinterfaces:
WXMBootConfigurationsSerializerProviderType, WXMClientConfigurationSerializerProviderType, WXMVirtualMachineSerializerProviderType
All Known Implementing Classes:
WXMBootConfigurationsSerializers, WXMClientConfigurationSerializers, WXMVirtualMachineSerializers

public interface WXMSerializerProviderType<T>
The type of serializer providers.
  • Method Summary

    Modifier and Type Method Description
    WXMSerializerType create​(java.net.URI uri, java.io.OutputStream stream, T value)
    Create a new serializer.
    default void serialize​(java.nio.file.Path output, java.nio.file.Path outputTmp, T value)
    A convenience method to serialize data to a file.
  • Method Details

    • create

      WXMSerializerType create​(java.net.URI uri, java.io.OutputStream stream, T value) throws java.io.IOException
      Create a new serializer.
      Parameters:
      uri - The URI of the output
      stream - The output stream
      value - The value to serialize
      Returns:
      A new serializer
      Throws:
      java.io.IOException - On I/O errors
    • serialize

      default void serialize​(java.nio.file.Path output, java.nio.file.Path outputTmp, T value) throws java.io.IOException
      A convenience method to serialize data to a file. The output is written to the given temporary file and then atomically renamed to the given output path. This prevents any external processes from seeing half-written data. The given paths should both refer to the same underlying filesystem, as operating systems typically have this restriction when atomically renaming files.
      Parameters:
      output - The output path
      outputTmp - The temporary output path
      value - The value to serialize
      Throws:
      java.io.IOException - On I/O errors