
package de.ivu.elect.exchange.image.mapper;

import javax.annotation.Nullable;

import de.ivu.elect.business.image.entity.Bild;

public class BildMapper {

  public BildMapper() {
    super();
  }

  @Nullable
  public de.ivu.elect.interfaces.core.Bild extern(Bild source) {
    if (source == null) {
      return null;
    }

    de.ivu.elect.interfaces.core.Bild target = new de.ivu.elect.interfaces.core.Bild();
    extern(source, target);

    return target;
  }

  public void extern(Bild source, de.ivu.elect.interfaces.core.Bild target) {
    target.setContentBase64(source.getContentBase64());
    target.setMimeType(source.getMimeType());
  }

  @Nullable
  public Bild intern(de.ivu.elect.interfaces.core.Bild source) {
    if (source == null) {
      return null;
    }

    Bild target = new Bild();
    intern(source, target);

    return target;
  }

  public void intern(de.ivu.elect.interfaces.core.Bild source, Bild target) {
    target.setContentBase64(source.getContentBase64());
    target.setMimeType(source.getMimeType());
  }
}
