Changeset 13611 in josm for trunk/src/org/openstreetmap/josm/data/osm
- Timestamp:
- 2018-04-10T19:02:58+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/OsmUtils.java
r12986 r13611 3 3 4 4 import java.util.Arrays; 5 import java.util.Collection; 5 6 import java.util.HashSet; 6 7 import java.util.Locale; 7 8 import java.util.Map; 9 import java.util.Objects; 8 10 import java.util.Set; 9 11 … … 153 155 return layer1; 154 156 } 157 158 /** 159 * Determines if the given collection contains primitives, and that none of them belong to a locked layer. 160 * @param collection collection of OSM primitives 161 * @return {@code true} if the given collection is not empty and does not contain any primitive in a locked layer. 162 * @since 13611 163 */ 164 public static boolean isOsmCollectionEditable(Collection<? extends OsmPrimitive> collection) { 165 return collection != null && !collection.isEmpty() 166 && collection.stream().map(OsmPrimitive::getDataSet).filter(Objects::nonNull).noneMatch(DataSet::isLocked); 167 } 155 168 }
Note:
See TracChangeset
for help on using the changeset viewer.