All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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