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

import java.util.function.Function;

import de.ivu.elect.business.konfiguration.entity.Konfiguration;
import de.ivu.elect.business.konfiguration.entity.KonfigurationConstants;
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 AbstractKonfigurationColumn<E extends Konfiguration> extends
            DefaultColumnEntry<E>
        {
    private static final long serialVersionUID = 1L;

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

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

            
            public static <E extends Konfiguration> AbstractKonfigurationColumn<E> createKonfigurationSchluesselColumn(Messages messages){
            return new AbstractKonfigurationColumn<>("Konfiguration-Schluessel", messages, de.ivu.elect.business.konfiguration.entity.KonfigurationConstants.MESSAGE_KEY_SCHLUESSEL_EINZAHL,
                            ColumnType.STRING
                        , Konfiguration::getSchluessel);
            }




                    
            public static <E extends Konfiguration> AbstractKonfigurationColumn<E> createKonfigurationWertColumn(Messages messages){
            return new AbstractKonfigurationColumn<>("Konfiguration-Wert", messages, de.ivu.elect.business.konfiguration.entity.KonfigurationConstants.MESSAGE_KEY_WERT_EINZAHL,
                            ColumnType.STRING
                        , Konfiguration::getWert);
            }




            
    
        public static <E extends Konfiguration> AbstractKonfigurationColumn<E> createMandantColumn(Messages messages, ColumnType type, Function<E, Object> getter){
        return new AbstractKonfigurationColumn<>("Konfiguration-Mandant", messages, de.ivu.elect.business.konfiguration.entity.KonfigurationConstants.MESSAGE_KEY_MANDANT_ID_EINZAHL,
        type
        , getter);
        }

    



    }
