Search in sources :

Example 1 with Image

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

the class AvroTransformer method forwardImage.

private Image forwardImage(data.media.Image image) {
    Image i = new Image();
    i.setUri(image.uri);
    i.setTitle(image.title);
    i.setWidth(image.width);
    i.setHeight(image.height);
    i.setSize(forwardSize(image.size));
    return i;
}
Also used : Image(serializers.avro.media.Image)

Example 2 with Image

use of serializers.avro.media.Image 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

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