com.fincatto.documentofiscal.transformers.DFLocalTimeTransformer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nfe Show documentation
Show all versions of nfe Show documentation
Biblioteca de comunicacao de nota fiscal eletronica brasileira
package com.fincatto.documentofiscal.transformers;
import org.simpleframework.xml.transform.Transform;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter;
public class DFLocalTimeTransformer implements Transform {
@Override
public LocalTime read(final String time) {
return LocalTime.from(DateTimeFormatter.ofPattern("HH:mm:ss").parse(time));
}
@Override
public String write(final LocalTime localTime) {
return DateTimeFormatter.ofPattern("HH:mm:ss").format(localTime);
}
}