fatiador.writer.NumericWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fatiador Show documentation
Show all versions of fatiador Show documentation
Convert flat strings to Java objects and vice-versa.
The newest version!
package fatiador.writer;
import com.google.common.base.Strings;
import fatiador.FlatField;
public class NumericWriter implements FieldWriter {
@Override
public String write(Object value, FlatField flatField) {
int size = flatField.getSize();
return Strings.padStart(Strings.nullToEmpty((String) value).trim(), size, '0');
}
}