Search in sources :

Example 1 with MediaContent

use of serializers.avro.media.MediaContent in project jvm-serializers by eishay.

the class AvroTransformer method forward.

// ----------------------------------------------------------
// Forward
public MediaContent forward(data.media.MediaContent mc) {
    GenericArray<Image> images = new GenericData.Array<Image>(mc.images.size(), Avro.Media.sImages);
    for (data.media.Image image : mc.images) {
        images.add(forwardImage(image));
    }
    MediaContent amc = new MediaContent();
    amc.setMedia(forwardMedia(mc.media));
    amc.setImages(images);
    return amc;
}
Also used : GenericArray(org.apache.avro.generic.GenericArray) MediaContent(serializers.avro.media.MediaContent) Image(serializers.avro.media.Image)

Aggregations

GenericArray (org.apache.avro.generic.GenericArray)1 Image (serializers.avro.media.Image)1 MediaContent (serializers.avro.media.MediaContent)1