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

import java.util.function.Function;

import de.ivu.elect.business.email.entity.Email;
import de.ivu.elect.business.email.entity.EmailConstants;
import de.ivu.elect.presentation.table.DefaultColumnEntry;
import de.ivu.elect.jee.presentation.dynamictable.ColumnType;

import de.ivu.elect.jee.faces.Messages;

@javax.enterprise.inject.Vetoed
public class AbstractEmailColumn<E extends Email> extends
            DefaultColumnEntry<E>
        {
    private static final long serialVersionUID = 1L;

    @Deprecated // Eindeutige Id vergeben, wichtig für Spaltenreihenfolge ELECT-4631
    protected AbstractEmailColumn(Messages messages, String headerKey, ColumnType type, Function<E, Object> getter) {
      super(messages, headerKey, type, getter);
    }

    protected  AbstractEmailColumn(String id, Messages messages, String headerKey, ColumnType type, Function<E, Object> getter) {
      super(id, messages, headerKey, type, getter);
    }

            
            public static <E extends Email> AbstractEmailColumn<E> createEmailAnzahlSendeversucheColumn(Messages messages){
            return new AbstractEmailColumn<>("Email-AnzahlSendeversuche", messages, de.ivu.elect.business.email.entity.EmailConstants.MESSAGE_KEY_ANZAHL_SENDEVERSUCHE_EINZAHL,
                            ColumnType.LONG
                        , Email::getAnzahlSendeversuche);
            }




                    
            public static <E extends Email> AbstractEmailColumn<E> createEmailEmpfaengerColumn(Messages messages){
            return new AbstractEmailColumn<>("Email-Empfaenger", messages, de.ivu.elect.business.email.entity.EmailConstants.MESSAGE_KEY_EMPFAENGER_EINZAHL,
                            ColumnType.STRING
                        , Email::getEmpfaenger);
            }




                    
            public static <E extends Email> AbstractEmailColumn<E> createEmailFehlermeldungColumn(Messages messages){
            return new AbstractEmailColumn<>("Email-Fehlermeldung", messages, de.ivu.elect.business.email.entity.EmailConstants.MESSAGE_KEY_FEHLERMELDUNG_EINZAHL,
                            ColumnType.STRING
                        , Email::getFehlermeldung);
            }




                                
            public static <E extends Email> AbstractEmailColumn<E> createEmailLetzterSendeversuchColumn(Messages messages){
            return new AbstractEmailColumn<>("Email-LetzterSendeversuch", messages, de.ivu.elect.business.email.entity.EmailConstants.MESSAGE_KEY_LETZTER_SENDEVERSUCH_EINZAHL,
                            ColumnType.TIMESTAMP
                        , Email::getLetzterSendeversuch);
            }




                    
            public static <E extends Email> AbstractEmailColumn<E> createEmailStatusColumn(Messages messages){
            return new AbstractEmailColumn<>("Email-Status", messages, de.ivu.elect.business.email.entity.EmailConstants.MESSAGE_KEY_STATUS_EINZAHL,
                            ColumnType.ENUM
                        , Email::getStatus);
            }




            
    
        public static <E extends Email> AbstractEmailColumn<E> createEmailVorgangColumn(Messages messages, ColumnType type, Function<E, Object> getter){
        return new AbstractEmailColumn<>("Email-EmailVorgang", messages, de.ivu.elect.business.email.entity.EmailConstants.MESSAGE_KEY_EMAIL_VORGANG_ID_EINZAHL,
        type
        , getter);
        }

    
        public static <E extends Email> AbstractEmailColumn<E> createPersonendatenColumn(Messages messages, ColumnType type, Function<E, Object> getter){
        return new AbstractEmailColumn<>("Email-Personendaten", messages, de.ivu.elect.business.email.entity.EmailConstants.MESSAGE_KEY_PERSONENDATEN_ID_EINZAHL,
        type
        , getter);
        }

    



    }
