Class ImageToJsonTranslator


  • public class ImageToJsonTranslator
    extends java.lang.Object
    Translates an Image into a manifest or container configuration JSON.
    • Constructor Detail

      • ImageToJsonTranslator

        public ImageToJsonTranslator​(Image image)
        Instantiate with an Image.
        Parameters:
        image - the image to translate
    • Method Detail

      • getContainerConfiguration

        public JsonTemplate getContainerConfiguration()
        Gets the container configuration.
        Returns:
        the container configuration
      • getManifestTemplate

        public <T extends BuildableManifestTemplate> T getManifestTemplate​(java.lang.Class<T> manifestTemplateClass,
                                                                           BlobDescriptor containerConfigurationBlobDescriptor)
        Gets the manifest as a JSON template. The containerConfigurationBlobDescriptor must be the BlobDescriptor obtained by writing out the container configuration JSON returned from getContainerConfiguration().
        Type Parameters:
        T - child type of BuildableManifestTemplate.
        Parameters:
        manifestTemplateClass - the JSON template to translate the image to.
        containerConfigurationBlobDescriptor - the container configuration descriptor.
        Returns:
        the image contents serialized as JSON.