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

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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy