Ignore:
Timestamp:
2017-08-12T11:24:39+02:00 (2 years ago)
Author:
bastiK
Message:

fixed #15139 - raster-image filter settings are Not Stored when saving session (color Saturation, Brightness, Sharpness)

File:
1 edited

Legend:

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

    r12238 r12594  
    5555import java.util.regex.Matcher;
    5656import java.util.regex.Pattern;
     57import java.util.stream.Stream;
    5758import java.util.zip.GZIPInputStream;
    5859import java.util.zip.ZipEntry;
     
    16901691        return null;
    16911692    }
     1693
     1694    /**
     1695     * Get a function that converts an object to a singleton stream of a certain
     1696     * class (or null if the object cannot be cast to that class).
     1697     *
     1698     * Can be useful in relation with streams, but be aware of the performance
     1699     * implications of creating a stream for each element.
     1700     * @param <T> type of the objects to convert
     1701     * @param <U> type of the elements in the resulting stream
     1702     * @param klass the class U
     1703     * @return function converting an object to a singleton stream or null
     1704     */
     1705    public static <T, U> Function<T, Stream<U>> castToStream(Class<U> klass) {
     1706        return x -> klass.isInstance(x) ? Stream.of(klass.cast(x)) : null;
     1707    }
    16921708}
Note: See TracChangeset for help on using the changeset viewer.