package com.airlock.iam.common.application;

import com.airlock.iam.base.api.domain.model.user.UserId;
import com.airlock.iam.common.api.domain.model.user.UserIdentity;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public final class UserParam {
   private final UserIdentity userIdentity;

   public UserId getUserId() {
      return this.userIdentity.id();
   }

   public String getUriUserId() {
      return this.userIdentity.providedUsername().getValue();
   }

   @SuppressFBWarnings(justification = "generated code")
   public UserParam(UserIdentity userIdentity) {
      this.userIdentity = userIdentity;
   }

   @SuppressFBWarnings(justification = "generated code")
   public UserIdentity getUserIdentity() {
      return this.userIdentity;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "UserParam(userIdentity=" + this.getUserIdentity() + ")";
   }
}
