title: Java pass variable into mapped DTO method?
body: <p>I have Spring Boot Application with implementation containing methods with following functions. The implementation uses 2 DTO's to bind data with. Is there an appropriate way how I could pass value from <strong><em>JAY</em></strong> to value where '<strong><em>10.00</em></strong>' is hardcoded? I have main issue with '<strong><em>this::convertProfileToProfileCreditDTO</em></strong>' is it possible to pass a parameter in this expression?
  <br>I have used <a href="https://stackoverflow.com/questions/59287209/java-dto-object-search-mechanism">Java DTO Object search mechanism?</a> for insipration</p>
  
  <p><br>
  If I try to add a parameter within code snipped below the this::convertProfileToProfileCreditDTO complains about bad return type </p>
  
  <pre><code>convertProfileToProfileCreditDTO(final Profile theProfile, Double JAY)
  </code></pre>
  
  <p><br>
  <strong>Implementation</strong> </p>
  
  <pre><code> @Override
      public Double testThisParam(Double profileCredit) {
          Double JAY = profileCredit;
          log.error(String.valueOf(JAY));
          return JAY;
      }
  
      @Override
      public Page&lt;ProfileCreditDTO&gt; findProfileBySelectedParameters(String username, Pageable pageable) {
  
          Page&lt;Profile&gt; searchData= profileRepository.findByAllParameters(username, pageable);
  
          Page&lt;ProfileCreditDTO&gt; searchProfileData=null;
  
          if(searchData != null)
              searchProfileData=searchData.map(this::convertProfileToProfileCreditDTO);
          return searchProfileData;
      }        
  
  public ProfileCreditDTO convertProfileToProfileCreditDTO(final Profile theProfile ){
  
          if(theProfile == null)
              return null;
          ProfileCreditDTO theDTO= new ProfileCreditDTO();
  
          theDTO.setProfile(theProfile);
  
          CreditDTO theCreditDto = profileCreditClient.findClientByProfileId(theProfile.getId(), 10.00);
  
          if(theCreditDto != null )
              theDTO.setCredit(theCreditDto);
          else {
  
              return null;
  
          }
  
          return theDTO;
      }
  </code></pre>