package com.airlock.iam.oauth2.api.domain.model.tokenexchange;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import lombok.NonNull;

public final class OAuth2TokenExchangeRawToken {
   @NonNull
   private final String value;
   @NonNull
   private final OAuth2TokenExchangeTokenType type;

   @SuppressFBWarnings(justification = "generated code")
   OAuth2TokenExchangeRawToken(@NonNull String value, @NonNull OAuth2TokenExchangeTokenType type) {
      if (value == null) {
         throw new NullPointerException("value is marked non-null but is null");
      }

      if (type == null) {
         throw new NullPointerException("type is marked non-null but is null");
      }

      this.value = value;
      this.type = type;
   }

   @SuppressFBWarnings(justification = "generated code")
   public static OAuth2TokenExchangeRawToken.OAuth2TokenExchangeRawTokenBuilder builder() {
      return new OAuth2TokenExchangeRawToken.OAuth2TokenExchangeRawTokenBuilder();
   }

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

   @NonNull
   @SuppressFBWarnings(justification = "generated code")
   public OAuth2TokenExchangeTokenType getType() {
      return this.type;
   }

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

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

   @SuppressFBWarnings(justification = "generated code")
   @Override
   public String toString() {
      return "OAuth2TokenExchangeRawToken(value=" + this.getValue() + ", type=" + this.getType() + ")";
   }

   @SuppressFBWarnings(justification = "generated code")
   public static class OAuth2TokenExchangeRawTokenBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private String value;
      @SuppressFBWarnings(justification = "generated code")
      private OAuth2TokenExchangeTokenType type;

      @SuppressFBWarnings(justification = "generated code")
      OAuth2TokenExchangeRawTokenBuilder() {
      }

      @SuppressFBWarnings(justification = "generated code")
      public OAuth2TokenExchangeRawToken.OAuth2TokenExchangeRawTokenBuilder value(@NonNull String value) {
         if (value == null) {
            throw new NullPointerException("value is marked non-null but is null");
         }

         this.value = value;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public OAuth2TokenExchangeRawToken.OAuth2TokenExchangeRawTokenBuilder type(@NonNull OAuth2TokenExchangeTokenType type) {
         if (type == null) {
            throw new NullPointerException("type is marked non-null but is null");
         }

         this.type = type;
         return this;
      }

      @SuppressFBWarnings(justification = "generated code")
      public OAuth2TokenExchangeRawToken build() {
         return new OAuth2TokenExchangeRawToken(this.value, this.type);
      }

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