package moulder.values;

import moulder.Value;

/**
 * A <code>Value</code> that transforms the values generated by another delegate
 * <code>Value</code>
 *
 * @param <S> the delegate <code>Value</code> value's type
 * @param <T> the resulting value's type
 * @author jawher
 */
public abstract class ValueTransformer<S, T> implements Value<T> {
    private Value<S> delegate;

    public ValueTransformer(Value<S> delegate) {
        this.delegate = delegate;
    }

    /**
     * Transforms the delegate's <code>Value</code> generated value
     *
     * @param s the delegate's <code>Value</code> generated value
     * @return
     */
    protected abstract T transform(S s);

    /**
     * @return the transformed value
     */
    public T get() {
        return transform(delegate.get());
    }

}

package moulder.values;

import moulder.Value;

/**
 * A <code>Value</code> that transforms the values generated by another delegate
 * <code>Value</code>
 *
 * @param <S> the delegate <code>Value</code> value's type
 * @param <T> the resulting value's type
 * @author jawher
 */
public abstract class ValueTransformer<S, T> implements Value<T> {
    private Value<S> delegate;

    public ValueTransformer(Value<S> delegate) {
        this.delegate = delegate;
    }

    /**
     * Transforms the delegate's <code>Value</code> generated value
     *
     * @param s the delegate's <code>Value</code> generated value
     * @return the transformed value
     */
    protected abstract T transform(S s);

    /**
     * @return the transformed value
     */
    public T get() {
        return transform(delegate.get());
    }

}

Fix a javadoc warning