package com.airlock.iam.common.api.domain.model.phonenumber;

import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import org.apache.commons.lang3.Validate;

public final class PhoneNumber {
   private final String value;

   private PhoneNumber(String value) {
      Validate.notBlank(value);
      this.value = value;
   }

   public static PhoneNumber phoneNumber(String value) {
      return new PhoneNumber(value);
   }

   @Override
   public String toString() {
      return "PhoneNumber[***]";
   }

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

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

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