/*
 * Fachlicher Schlüssel für JPA Entität
 */
package de.ivu.elect.business.email.entity;

import de.ivu.elect.jee.faces.Messages;
import de.ivu.elect.jee.faces.IMessages;
import java.util.function.Function;

@javax.enterprise.inject.Vetoed
public class EmailVorgangTK
implements de.ivu.elect.jee.entity.tk.EntityTK, java.io.Serializable
  {

  private static final long serialVersionUID = 1L;

  private final int hashCode;


  public EmailVorgangTK(
  ) {
    super();


    
hashCode = calculateHashCode();
  }

  @Override
  public int hashCode(){
    return hashCode;
  }


  protected int calculateHashCode() {
        int result = 1;
    
    
    return result;
  }

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

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

    if (hashCode()!=obj.hashCode()) {
      return false;
    }


                // Keine Attribute definiert => nicht gleich
    return false;
    
  }

  protected boolean hatAttribute() {
              return false;
            }

  @Override
  public String getEntityMessageKey() {
    return EmailVorgangConstants.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(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 "EmailVorgangTK[" + toStringParameter() + "]";
            }



            protected String toStringParameter() {
            String result = ""

                                    
            ;
                            return result;
            
            }

  @Override
  public String toStringLokalisiert(IMessages messages) {
    return messages.getMessageForMessageKey(getEntityMessageKey()) + " ["
            + toStringLokalisiertFields(messages)
            + "]"
            ;
   }

            protected String toStringLokalisiertFields(IMessages messages) {
        return ""
                                                         ;
      }


            private String toStringLokalisiert(de.ivu.elect.jee.entity.tk.EntityTK entityTK, IMessages messages) {
                if (entityTK != null) {
                    return entityTK.toStringLokalisiert(messages);
                }
                return null;
            }

            public static <E extends EmailVorgang> java.util.Map<EmailVorgangTK, E> mappeEmailVorgangNachTK(java.util.Collection<E> entities) {
                return entities.stream().collect(java.util.stream.Collectors.toMap(EmailVorgang::getEmailVorgangTK, Function.<E>identity(), (u,v)-> v));
                }


                public static Function<EmailVorgang, EmailVorgangTK> getEmailVorgangToTKFunction() {
                return EmailVorgang::getEmailVorgangTK;
                }

}
