Authored by A F

The problem!

I need to be able to create VideoConversion, AudioConversion ecc (VideoConversion means input of type Video) each conversion is composed by different operation that take input type (Video, Image, ecc) and produce an Output (Metadata, Image, Video, ecc) All this conversion and operation are structurally identical, the thing that changes are Params (each operation have it's params) Input and Output I'd like to keep only one structure to write code more maintainable. Conversion and operations must be serializable to json and vice versa


   val imageConversion = ImageConversion(
    operations = List(
      ImageToImageOperation(height = 10, width = 100),
      ImageToMetadataOperation(format = JSON)

   val videoConversion = VideoConversion(
    operations = List(
      VideoToImageOperation(frameToTake = 10),
      VideoToMetadataOperation(format = JSON)

What i would like to do is use same structure (same case class or abstract class) for all (video, image, audio, ecc) conversion, because the only differences are type of operation and the input type, */

example.scala 18 Bytes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment