package com.airlock.iam.common.domain.model.email;

import com.airlock.iam.common.domain.model.locale.ResourceKey;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public final class EmailMessageTemplate {
   private final ResourceKey keyForSubject;
   private final ResourceKey keyForBody;
   private final boolean sendAsHtml;

   @SuppressFBWarnings(justification = "generated code")
   public EmailMessageTemplate(ResourceKey keyForSubject, ResourceKey keyForBody, boolean sendAsHtml) {
      this.keyForSubject = keyForSubject;
      this.keyForBody = keyForBody;
      this.sendAsHtml = sendAsHtml;
   }

   @SuppressFBWarnings(justification = "generated code")
   public ResourceKey getKeyForSubject() {
      return this.keyForSubject;
   }

   @SuppressFBWarnings(justification = "generated code")
   public ResourceKey getKeyForBody() {
      return this.keyForBody;
   }

   @SuppressFBWarnings(justification = "generated code")
   public boolean isSendAsHtml() {
      return this.sendAsHtml;
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public boolean equals(Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof EmailMessageTemplate other)) {
         return false;
      } else if (this.sendAsHtml != other.sendAsHtml) {
         return false;
      } else {
         Object this$keyForSubject = this.keyForSubject;
         Object other$keyForSubject = other.keyForSubject;
         if (this$keyForSubject == null ? other$keyForSubject == null : this$keyForSubject.equals(other$keyForSubject)) {
            Object this$keyForBody = this.keyForBody;
            Object other$keyForBody = other.keyForBody;
            return this$keyForBody == null ? other$keyForBody == null : this$keyForBody.equals(other$keyForBody);
         } else {
            return false;
         }
      }
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      result = result * 59 + (this.sendAsHtml ? 79 : 97);
      Object $keyForSubject = this.keyForSubject;
      result = result * 59 + ($keyForSubject == null ? 43 : $keyForSubject.hashCode());
      Object $keyForBody = this.keyForBody;
      return result * 59 + ($keyForBody == null ? 43 : $keyForBody.hashCode());
   }

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "EmailMessageTemplate(keyForSubject="
         + this.getKeyForSubject()
         + ", keyForBody="
         + this.getKeyForBody()
         + ", sendAsHtml="
         + this.isSendAsHtml()
         + ")";
   }
}
