package com.airlock.iam.application.parameters.domain.model;

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

public final class HealthCheckParameters {
   private final String allowedRemoteIpAddresses;
   private final Optional<Integer> port;

   public HealthCheckParameters(String allowedRemoteIpAddresses, Optional<Integer> port) {
      this.allowedRemoteIpAddresses = Objects.requireNonNull(allowedRemoteIpAddresses);
      this.port = port;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public Optional<Integer> port() {
      return this.port;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "HealthCheckParameters(allowedRemoteIpAddresses=" + this.allowedRemoteIpAddresses() + ", port=" + this.port() + ")";
   }
}
