org.aksw.jenax.arq.aggregation.FunctionBindingMapper Maven / Gradle / Ivy
The newest version!
package org.aksw.jenax.arq.aggregation;
import java.util.function.Function;
import org.apache.jena.sparql.engine.binding.Binding;
/**
* Guava Function wrapper for BindingMapper objects
*
* @author raven
*
*/
public class FunctionBindingMapper
implements Function
{
private BindingMapper bindingMapper;
private long offset;
public FunctionBindingMapper(BindingMapper bindingMapper) {
this(bindingMapper, 0);
}
public FunctionBindingMapper(BindingMapper bindingMapper, long offset) {
this.bindingMapper = bindingMapper;
this.offset = offset;
}
@Override
public T apply(Binding binding) {
T result = bindingMapper.apply(binding, offset);
return result;
}
public static FunctionBindingMapper create(BindingMapper bindingMapper) {
FunctionBindingMapper result = new FunctionBindingMapper(bindingMapper);
return result;
}
}