org.javers.java8support.YearTypeAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javers-core Show documentation
Show all versions of javers-core Show documentation
JaVers - object auditing and diff framework for Java
package org.javers.java8support;
import org.javers.core.json.BasicStringTypeAdapter;
import java.time.Year;
/**
* @author bartosz.walacik
*/
class YearTypeAdapter extends BasicStringTypeAdapter {
@Override
public String serialize(Year sourceValue) {
return sourceValue.toString();
}
@Override
public Year deserialize(String serializedValue) {
return Year.parse(serializedValue);
}
@Override
public Class getValueType() {
return Year.class;
}
}