0

I need to autowire my GdsClientHandler I have tried autowiring through constructor, setter methods but still it returns to be null.

@Mapper(componentModel = "spring")
public abstract class SaveHistoryBOToEntityMapper {

  @Autowired
  private GdsClientHandler gdsClientHandler;

  public Set<String> getCityName(final Set<Long> cityIdList, final String countryCode) {
    Set<String> cityList = new HashSet<String>();

    if(cityIdList.isEmpty() || countryCode==null)
    {
      return cityList;
    }
    else
    { cityList = cityIdList.stream().map(cityId -> this.gdsClientHandler.findCityByCountryCode(countryCode, cityId).getCityName()).collect(Collectors.toSet());
    return cityList;}
  }
Shubham Parmar
  • 147
  • 1
  • 13
  • Please go through the answer : [How to create bean using @Bean in spring boot for abstract class](https://stackoverflow.com/a/48440850/4214241) – R.G Apr 27 '20 at 05:13
  • 1
    How are you getting an instance from your mapper? – Filip Apr 27 '20 at 05:46

0 Answers0