package com.airlock.iam.base.infrastructure.mapper;

import com.airlock.iam.base.api.domain.model.validation.ValidatorError;
import com.airlock.iam.base.api.infrastructure.exception.RestErrorCode;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public final class StaticErrorCodeMapper implements ErrorCodeMapper {
   private final RestErrorCode errorCode;

   @Override
   public RestErrorCode map(ValidatorError error) {
      return this.errorCode;
   }

   public static StaticErrorCodeMapper of(RestErrorCode errorCode) {
      return new StaticErrorCodeMapper(errorCode);
   }

   @SuppressFBWarnings(justification = "generated code")
   private StaticErrorCodeMapper(RestErrorCode errorCode) {
      this.errorCode = errorCode;
   }
}
