com.redis.spring.batch.common.ToScoredValueFunction Maven / Gradle / Ivy
The newest version!
package com.redis.spring.batch.common;
import java.util.function.Function;
import java.util.function.ToDoubleFunction;
import io.lettuce.core.ScoredValue;
public class ToScoredValueFunction implements Function> {
private final Function member;
private final ToDoubleFunction score;
public ToScoredValueFunction(Function member, ToDoubleFunction score) {
this.member = member;
this.score = score;
}
@Override
public ScoredValue apply(T source) {
return ScoredValue.just(score.applyAsDouble(source), member.apply(source));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy