/*
 * Unique Schlüssel für JPA Entität
 */
package de.ivu.elect.business.wahlvorschlag.entity;
import java.util.function.Function;
import java.util.ArrayList;
import java.util.stream.Collectors;

@javax.enterprise.inject.Vetoed
public class DirektkandidatUK
extends de.ivu.elect.business.wahlvorschlag.entity.WahlvorschlagUK
  {

  private static final long serialVersionUID = 1L;



  public DirektkandidatUK(
java.lang.String discriminator
,   de.ivu.elect.business.gruppeimgebiet.entity.GruppeImGebietUK gruppeImGebietUK
  ) {
super(
discriminator
,   gruppeImGebietUK
);


      }

  @Override
  public int hashCode() {
        int result = super.hashCode();
    
    
    return result;
  }

  @Override
  public boolean equals(Object obj) {
    if (this == obj) {
      return true;
    }

    if (obj == null) {
      return false;
    }

        if (!super.equals(obj)) {
      return false;
    }
    
    if (getClass() != obj.getClass()) {
      return false;
    }

    
    return true;
  }

  @Override
  public String getEntityMessageKey() {
    return DirektkandidatConstants.MESSAGE_KEY_ENTITY_EINZAHL;
  }

  @Override
  public java.util.List<de.ivu.elect.jee.entity.tk.EntityFieldValue> getAllEntityFieldValues() {
    java.util.List<de.ivu.elect.jee.entity.tk.EntityFieldValue> result = new java.util.ArrayList<>();

    result.addAll(super.getAllEntityFieldValues());
    result.addAll(getEntityFieldValuesForEntity());
    return result;
  }

  @Override
  public java.util.List<de.ivu.elect.jee.entity.tk.EntityFieldValue> getEntityFieldValuesForEntity() {
            return java.util.Collections.emptyList();
      }
  
    @Override
  public String toString() {
    return "DirektkandidatUK[" + toStringParameter() + "]";
  }

            protected String toStringParameter() {
              String result = ""

                                                ;
                            String resultParent = super.toStringParameter();
                if (resultParent.isEmpty()) {
                  return result;
                }
                if (result.isEmpty()) {
                  return resultParent;
                }
                return resultParent +", " + result;
            
            }




        
   @Override
   protected ArrayList<Object> getAllUKFieldValues() {
              ArrayList<Object> list = super.getAllUKFieldValues();
          return list;
   }

            public static <E extends Direktkandidat> java.util.Map<DirektkandidatUK, E> mappeDirektkandidatNachUK(java.util.Collection<E> entities) {

                return entities.stream().collect(java.util.stream.Collectors.toMap(Direktkandidat::getDirektkandidatUK, Function.<E>identity(), (u,v)->v));
             }


                public static Function<Direktkandidat, DirektkandidatUK> getDirektkandidatToUKFunction() {
                return Direktkandidat::getDirektkandidatUK;
                }

}
