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

import java.util.function.Function;

import de.ivu.elect.business.wertelisten.entity.Wertelisten;
import de.ivu.elect.business.wertelisten.entity.WertelistenConstants;
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 AbstractWertelistenColumn<E extends Wertelisten> extends
            DefaultColumnEntry<E>
        {
    private static final long serialVersionUID = 1L;

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

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

            
            public static <E extends Wertelisten> AbstractWertelistenColumn<E> createWertelistenNameColumn(Messages messages){
            return new AbstractWertelistenColumn<>("Wertelisten-Name", messages, de.ivu.elect.business.wertelisten.entity.WertelistenConstants.MESSAGE_KEY_NAME_EINZAHL,
                            ColumnType.STRING
                        , Wertelisten::getName);
            }




                    
            public static <E extends Wertelisten> AbstractWertelistenColumn<E> createWertelistenWertelistenArtColumn(Messages messages){
            return new AbstractWertelistenColumn<>("Wertelisten-WertelistenArt", messages, de.ivu.elect.business.wertelisten.entity.WertelistenConstants.MESSAGE_KEY_WERTELISTEN_ART_EINZAHL,
                            ColumnType.ENUM
                        , Wertelisten::getWertelistenArt);
            }




            
    
        public static <E extends Wertelisten> AbstractWertelistenColumn<E> createWahlColumn(Messages messages, ColumnType type, Function<E, Object> getter){
        return new AbstractWertelistenColumn<>("Wertelisten-Wahl", messages, de.ivu.elect.business.wertelisten.entity.WertelistenConstants.MESSAGE_KEY_WAHL_ID_EINZAHL,
        type
        , getter);
        }

    



    }
