Ignore:
Timestamp:
2020-05-17T12:08:17+02:00 (4 years ago)
Author:
simon04
Message:

see #19251 - Java 8: use Stream

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/template_engine/CompoundTemplateEntry.java

    r14098 r16436  
    33
    44import java.util.Arrays;
     5import java.util.stream.Collectors;
    56
    67/**
     
    4142    @Override
    4243    public boolean isValid(TemplateEngineDataProvider dataProvider) {
    43         for (TemplateEntry te: entries) {
    44             if (!te.isValid(dataProvider))
    45                 return false;
    46         }
    47         return true;
     44        return Arrays.stream(entries).allMatch(te -> te.isValid(dataProvider));
    4845    }
    4946
    5047    @Override
    5148    public String toString() {
    52         StringBuilder result = new StringBuilder();
    53         for (TemplateEntry te: entries) {
    54             result.append(te);
    55         }
    56         return result.toString();
     49        return Arrays.stream(entries).map(String::valueOf).collect(Collectors.joining());
    5750    }
    5851
Note: See TracChangeset for help on using the changeset viewer.