Class ValueFilterValues<T,V>
java.lang.Object
com.evolveum.midpoint.repo.sqlbase.filtering.ValueFilterValues<T,V>
- Type Parameters:
T
- type of filter valueV
- type of value after conversion (can be the same as T)
Object wraps zero, one or multiple values and makes their processing easier.
Instead of just wrapping the values it uses the whole filter object
to utilize its convenience methods.
Returned values are typed to Object, because they can be converted from original type.
Conversion is moved into this class, so the client code doesn't have to handle translation
from
PrismPropertyValue
to "real value" and then to convert it.
Both singleValue()
and allValues()
are handled the same way.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns multiple values, all converted, or empty list - never null.Returns multiple real values without conversion or empty list - never null.static <T> ValueFilterValues<T,
T> from
(@NotNull PropertyValueFilter<T> filter) static <T,
V> ValueFilterValues<T, V> from
(@NotNull PropertyValueFilter<T> filter, @Nullable Function<T, V> conversionFunction) static <T,
V> ValueFilterValues<T, V> from
(@NotNull PropertyValueFilter<T> filter, com.querydsl.core.types.Expression<?> expression) boolean
isEmpty()
boolean
abstract V
Returns single value or null or fails if there are multiple values, all converted.@NotNull PolyString
abstract T
Returns single value or null or fails if there are multiple values without conversion.
-
Field Details
-
filter
-
-
Method Details
-
from
-
from
public static <T,V> ValueFilterValues<T,V> from(@NotNull @NotNull PropertyValueFilter<T> filter, com.querydsl.core.types.Expression<?> expression) -
from
public static <T,V> ValueFilterValues<T,V> from(@NotNull @NotNull PropertyValueFilter<T> filter, @Nullable @Nullable Function<T, V> conversionFunction) -
singleValue
Returns single value or null or fails if there are multiple values, all converted. If conversion function was provided anyIllegalArgumentException
orClassCastException
will be re-wrapped asQueryException
, other runtime exceptions are not intercepted.- Throws:
QueryException
-
singleValueRaw
Returns single value or null or fails if there are multiple values without conversion. Null-safe version ofValueFilter.getSingleValue()
followed byPrismPropertyValue.getRealValue()
. -
allValues
Returns multiple values, all converted, or empty list - never null. -
allValuesRaw
Returns multiple real values without conversion or empty list - never null. -
isEmpty
public boolean isEmpty() -
isMultiValue
public boolean isMultiValue() -
singleValuePolyString
- Throws:
QueryException
-