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

import java.util.function.Function;

import de.ivu.elect.business.person.entity.Tag;
import de.ivu.elect.business.person.entity.TagConstants;
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 AbstractTagColumn<E extends Tag> extends
            DefaultColumnEntry<E>
        {
    private static final long serialVersionUID = 1L;

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

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

            
            public static <E extends Tag> AbstractTagColumn<E> createTagBemerkungColumn(Messages messages){
            return new AbstractTagColumn<>("Tag-Bemerkung", messages, de.ivu.elect.business.person.entity.TagConstants.MESSAGE_KEY_BEMERKUNG_EINZAHL,
                            ColumnType.STRING
                        , Tag::getBemerkung);
            }




                    
            public static <E extends Tag> AbstractTagColumn<E> createTagNameColumn(Messages messages){
            return new AbstractTagColumn<>("Tag-Name", messages, de.ivu.elect.business.person.entity.TagConstants.MESSAGE_KEY_NAME_EINZAHL,
                            ColumnType.STRING
                        , Tag::getName);
            }




                    
            public static <E extends Tag> AbstractTagColumn<E> createTagNameNormalisiertColumn(Messages messages){
            return new AbstractTagColumn<>("Tag-NameNormalisiert", messages, de.ivu.elect.business.person.entity.TagConstants.MESSAGE_KEY_NAME_NORM_EINZAHL,
                            ColumnType.STRING
                        , Tag::getNameNormalisiert);
            }




                    
            public static <E extends Tag> AbstractTagColumn<E> createTagNeuerNameColumn(Messages messages){
            return new AbstractTagColumn<>("Tag-NeuerName", messages, de.ivu.elect.business.person.entity.TagConstants.MESSAGE_KEY_NEUER_NAME_EINZAHL,
                            ColumnType.STRING
                        , Tag::getNeuerName);
            }




                    
            public static <E extends Tag> AbstractTagColumn<E> createTagStatusColumn(Messages messages){
            return new AbstractTagColumn<>("Tag-Status", messages, de.ivu.elect.business.person.entity.TagConstants.MESSAGE_KEY_STATUS_EINZAHL,
                            ColumnType.ENUM
                        , Tag::getStatus);
            }




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

    



    }
