diff --git a/repo/repo-sqlbase/src/main/java/com/evolveum/midpoint/repo/sqlbase/filtering/ValueFilterValues.java b/repo/repo-sqlbase/src/main/java/com/evolveum/midpoint/repo/sqlbase/filtering/ValueFilterValues.java index c3afe7f2e4c..755dc161d1c 100644 --- a/repo/repo-sqlbase/src/main/java/com/evolveum/midpoint/repo/sqlbase/filtering/ValueFilterValues.java +++ b/repo/repo-sqlbase/src/main/java/com/evolveum/midpoint/repo/sqlbase/filtering/ValueFilterValues.java @@ -31,30 +31,30 @@ * from {@link PrismPropertyValue} to "real value" and then to convert it. * Both {@link #singleValue()} and {@link #allValues()} are handled the same way. * - * If {@link #conversionFunction} is used any {@link IllegalArgumentException} will be rewrapped + * If {@link #conversionFunction} is used any {@link IllegalArgumentException} will be re-wrapped * as {@link QueryException}, other runtime exceptions are not intercepted. * * @param type of filter value - * @param type of value after conversion (can by the same like T) + * @param type of value after conversion (can by the same like T) */ -public class ValueFilterValues { +public class ValueFilterValues { @NotNull private final PropertyValueFilter filter; - @Nullable private final Function conversionFunction; + @Nullable private final Function conversionFunction; public static ValueFilterValues from(@NotNull PropertyValueFilter filter) { return new ValueFilterValues<>(filter, null); } - public static ValueFilterValues from( + public static ValueFilterValues from( @NotNull PropertyValueFilter filter, - @Nullable Function conversionFunction) { + @Nullable Function conversionFunction) { return new ValueFilterValues<>(filter, conversionFunction); } private ValueFilterValues( @NotNull PropertyValueFilter filter, - @Nullable Function conversionFunction) { + @Nullable Function conversionFunction) { this.filter = Objects.requireNonNull(filter); this.conversionFunction = conversionFunction; } @@ -79,14 +79,15 @@ private ValueFilterValues( /** * Returns multiple values, all converted, or empty list - never null. */ - public @NotNull List allValues() { + public @NotNull List allValues() { if (filter.getValues() == null) { return Collections.emptyList(); } Stream realValueStream = filter.getValues().stream() .map(ppv -> ppv.getRealValue()); if (conversionFunction == null) { - return realValueStream.collect(Collectors.toList()); + //noinspection unchecked + return (List) realValueStream.collect(Collectors.toList()); } return realValueStream .map(conversionFunction)