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;
}
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;
}
Aggregations