List<UUID> insrVrfyIds = insrVrfyObjsNew.stream().map(insrVrfy -> insrVrfy.getCustomerInsrVrfyId()).collect(Collectors.toList());
For the following code, I get a warning, as I mentioned in the title. Can someone explain to me how to do this.
here, in the code above, I have a list of objects from which I want to extract all primary keys using a lambda expression. But I get a violation like " Replace this lambda with a method reference (sonar .java.source not installed. Suppose 8 or more.) "
Well, that probably means you could write it the same way:
List<UUID> insrVrfyIds = insrVrfyObjsNew.stream().map(InsrVrfy::getCustomerInsrVrfyId).collect(Collectors.toList());
, insrVrfy InsrVrfy, , , , .
.
List<UUID> insrVrfyIds = insrVrfyObjsNew.stream().map(CustomerInsrVrfy::getCustomerInsrVrfyId).collect(Collectors.toList());
.. , , (insrVrfy) (CustomerInsrVrfy).
Source: https://habr.com/ru/post/1685608/More articles:Как отфильтровать нечитаемые экранные шрифты? - fontsbuild int32_t of 4 values uint8_t - cHow to analyze only four-digit years - javaWhy is it pointing to the one before the first element of the array that is not allowed in C? - cHow to introduce type instead of instance into constructor using Unity - c #Proguard [java.lang.IllegalArgumentException: unsigned short value overflow] - androidStrict regular expression for matching chemical formulas - regexErlang Binary Leak? - erlangTake photos in portrait mode (bokeh) in iOS 11 / iPhone 7 / 8plus in a third-party application? - iosRegex for extracting chemical formulas and symbols - regexAll Articles