package ru.yandex.canvas.model.rtbhost;

import ru.yandex.adv.direct.media.Dimension;

public class DimensionBuilder {
    public static Dimension build(Integer width, Integer height) {
        if (width == null && height == null) {
            return null;
        }
        var builder = Dimension.newBuilder();
        if (width != null) {
            builder.setWidth(width);
        }
        if (height != null) {
            builder.setHeight(height);
        }
        return builder.build();
    }
}
