package com.airlock.iam.flow.shared.application.service.recovery;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.Optional;

final class RawSessionAttributeValue {
   private final String key;
   private final String value;

   static Optional<RawSessionAttributeValue> rawSessionAttributeValue(Optional<String> key, Optional<String> value) {
      return key.isPresent() && value.isPresent() ? Optional.of(new RawSessionAttributeValue(key.get(), value.get())) : Optional.empty();
   }

   @SuppressFBWarnings(justification = "generated code")
   public String key() {
      return this.key;
   }

   @SuppressFBWarnings(justification = "generated code")
   public String value() {
      return this.value;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "RawSessionAttributeValue(key=" + this.key() + ", value=" + this.value() + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   private RawSessionAttributeValue(String key, String value) {
      this.key = key;
      this.value = value;
   }
}
