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

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

import de.ivu.elect.jee.entity.EntityFachlichAbhaengigNode;
import de.ivu.elect.jee.entity.EntityTechnicalNamePk;

public class EntityTechnicalNamePkNode implements Serializable {

  private static final long serialVersionUID = 1L;

  private final String attributeName;

  private final EntityTechnicalNamePk entityTechnicalNamePk;

  private final List<EntityTechnicalNamePkNode> children = new ArrayList<>();

  public EntityTechnicalNamePkNode(EntityFachlichAbhaengigNode entityFachlichAbhaengigNode) {
    this(entityFachlichAbhaengigNode.getAttributeName(), new EntityTechnicalNamePk(entityFachlichAbhaengigNode.getEntity()));
    for (EntityFachlichAbhaengigNode fachlichAbhaengigNode : entityFachlichAbhaengigNode.getChildren()) {
      children.add(new EntityTechnicalNamePkNode(fachlichAbhaengigNode));
    }
  }

  public EntityTechnicalNamePkNode(String attributeName, EntityTechnicalNamePk entityTechnicalNamePk) {
    this.attributeName = attributeName;
    this.entityTechnicalNamePk = entityTechnicalNamePk;
  }

  public String getAttributeName() {
    return attributeName;
  }

  public EntityTechnicalNamePk getEntityTechnicalNamePk() {
    return entityTechnicalNamePk;
  }

  public List<EntityTechnicalNamePkNode> getChildren() {
    return children;
  }
}
