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

import com.airlock.iam.base.infrastructure.mapper.IdentityFieldMapper;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;

public class PrefixFieldMapper extends IdentityFieldMapper {
   private String prefix;

   @Override
   public String map(String modelField) {
      return super.map(this.prefix + "/" + modelField);
   }

   @SuppressFBWarnings(justification = "generated code")
   PrefixFieldMapper(String prefix) {
      this.prefix = prefix;
   }

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

   @SuppressFBWarnings(justification = "generated code")
   public static class PrefixFieldMapperBuilder {
      @SuppressFBWarnings(justification = "generated code")
      private String prefix;

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

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

      @SuppressFBWarnings(justification = "generated code")
      public PrefixFieldMapper build() {
         return new PrefixFieldMapper(this.prefix);
      }

      @SuppressFBWarnings(justification = "generated code")
      @Override
      public String toString() {
         return "PrefixFieldMapper.PrefixFieldMapperBuilder(prefix=" + this.prefix + ")";
      }
   }
}
