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

com.noodlesandwich.rekord.transformers.DefaultingTransformer Maven / Gradle / Ivy

There is a newer version: 0.3
Show newest version
package com.noodlesandwich.rekord.transformers;

public final class DefaultingTransformer implements Transformer {
    private final T defaultValue;

    public DefaultingTransformer(T defaultValue) {
        this.defaultValue = defaultValue;
    }

    @Override
    public T transformInput(T value) {
        return value;
    }

    @Override
    public T transformOutput(T value) {
        return value != null ? value : defaultValue;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy