com.noodlesandwich.rekord.transformers.DefaultingTransformer Maven / Gradle / Ivy
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