
package de.ivu.elect.presentation.person.table;

import org.apache.commons.lang3.StringUtils;

import de.ivu.elect.business.person.entity.Personendaten;
import de.ivu.elect.business.person.entity.PersonendatenConstants;
import de.ivu.elect.jee.faces.Messages;
import de.ivu.elect.jee.presentation.dynamictable.ColumnType;

public class PersonendatenEhrenamtColumn<E extends Personendaten> extends AbstractPersonendatenColumn<E> {

  private static final long serialVersionUID = 1L;

  public PersonendatenEhrenamtColumn(Messages messages) {
    super("Personendaten-Ehrenaemter", messages, PersonendatenConstants.MESSAGE_KEY_EHRENAMT_EINZAHL, ColumnType.STRING, personendaten -> {
      if (personendaten != null) {
        return personendaten.getEhrenaemterCommaSeparated();
      }

      return StringUtils.EMPTY;
    });
  }
}
