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

org.parsky.sequence.transform.ContentTransformation Maven / Gradle / Ivy

The newest version!
package org.parsky.sequence.transform;

import com.google.common.base.Function;
import org.parsky.sequence.model.Range;

public class ContentTransformation implements Transformation {
    private final Function, T> function;

    public ContentTransformation(Function, T> function) {
        this.function = function;
    }

    @Override
    public T transform(C context, Range range, I input) {
        return function.apply(new Request(context, range, input));
    }

    public static class Request {
        private final C context;
        private final Range range;
        private final V value;

        public Request(C context, Range range, V value) {
            this.context = context;
            this.range = range;
            this.value = value;
        }

        public C getContext() {
            return context;
        }

        public Range getRange() {
            return range;
        }

        public V getValue() {
            return value;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy