org.javers.java8support.ZoneOffsetTypeAdapter 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 org.javers.core.json.JsonTypeAdapter;
import java.time.ZoneOffset;
/**
* @author bartosz.walacik
*/
class ZoneOffsetTypeAdapter extends BasicStringTypeAdapter {
@Override
public String serialize(ZoneOffset sourceValue) {
return sourceValue.getId();
}
@Override
public ZoneOffset deserialize(String serializedValue) {
return ZoneOffset.of(serializedValue);
}
@Override
public Class getValueType() {
return ZoneOffset.class;
}
}