org.javers.core.json.typeadapter.util.FileTypeAdapter 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.core.json.typeadapter.util;
import org.javers.core.json.BasicStringTypeAdapter;
import java.io.File;
/**
* @author bartosz.walacik
*/
class FileTypeAdapter extends BasicStringTypeAdapter {
@Override
public String serialize(File sourceValue) {
return sourceValue.toString();
}
@Override
public File deserialize(String serializedValue) {
return new File(serializedValue);
}
@Override
public Class getValueType() {
return File.class;
}
}