Search in sources :

Example 1 with ParamKeyValueFilterConverterFactory

use of org.infinispan.filter.ParamKeyValueFilterConverterFactory in project infinispan by infinispan.

the class DefaultIterationManager method buildFilter.

private KeyValuePair<KeyValueFilterConverter, Boolean> buildFilter(KeyValueFilterConverterFactory factory, byte[][] params, Function<Object, Object> unmarshallParam) {
    if (factory instanceof ParamKeyValueFilterConverterFactory) {
        ParamKeyValueFilterConverterFactory paramFactory = (ParamKeyValueFilterConverterFactory) factory;
        Object[] unmarshallParams;
        if (paramFactory.binaryParam()) {
            unmarshallParams = params;
        } else {
            unmarshallParams = Arrays.stream(params).map(unmarshallParam).toArray();
        }
        return new KeyValuePair<>(paramFactory.getFilterConverter(unmarshallParams), paramFactory.binaryParam());
    } else {
        return new KeyValuePair<>(factory.getFilterConverter(), false);
    }
}
Also used : KeyValuePair(org.infinispan.util.KeyValuePair) ParamKeyValueFilterConverterFactory(org.infinispan.filter.ParamKeyValueFilterConverterFactory)

Aggregations

ParamKeyValueFilterConverterFactory (org.infinispan.filter.ParamKeyValueFilterConverterFactory)1 KeyValuePair (org.infinispan.util.KeyValuePair)1