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

@javax.enterprise.inject.Vetoed
public class KandidaturUK
extends de.ivu.elect.business.person.entity.PersonendatenUK
  {

  private static final long serialVersionUID = 1L;



  public KandidaturUK(
  ) {
super(
);


      }

  @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 KandidaturConstants.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 "KandidaturUK[" + 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 Kandidatur> java.util.Map<KandidaturUK, E> mappeKandidaturNachUK(java.util.Collection<E> entities) {

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


                public static Function<Kandidatur, KandidaturUK> getKandidaturToUKFunction() {
                return Kandidatur::getKandidaturUK;
                }

}
