package de.ivu.elect.business.gebietsbaum.entity;

import java.io.Serializable;
import java.util.List;

import javax.annotation.Nullable;

import org.apache.commons.lang3.StringUtils;

public class Svg implements Serializable {

  private final long width;

  private final long height;

  private final String styles;

  private SvgLegende legende;

  private SvgMap map;

  public Svg(List<SvgPath> paths, long width, long height) {
    this(paths, null, width, height, null);
  }

  public Svg(List<SvgPath> paths, long width, long height, @Nullable SvgLegende legende) {
    this(paths, legende, width, height, null);
  }

  public Svg(List<SvgPath> paths, @Nullable SvgLegende legende, long width, long height, String styles) {
    this.legende = legende;
    this.height = height;
    this.width = width;
    this.map = new SvgMap(paths);
    this.styles = styles;
  }

  public long getHeight() {
    return height;
  }

  public long getWidth() {
    return width;
  }

  public boolean isStylesPresent() {
    return StringUtils.isNotBlank(getStyles());
  }

  public String getStyles() {
    return styles;
  }

  public SvgLegende getLegende() {
    return legende;
  }

  public boolean isLegendePresent() {
    return getLegende() != null;
  }

  public SvgMap getMap() {
    return map;
  }

  public boolean isMapPresent() {
    return getMap() != null;
  }

}
