org.vertexium.VertexiumSerializer Maven / Gradle / Ivy
package org.vertexium;
public interface VertexiumSerializer {
byte[] objectToBytes(Object object);
T bytesToObject(byte[] bytes);
default T bytesToObject(ElementType elementType, String elementId, byte[] bytes) {
try {
return bytesToObject(bytes);
} catch (Exception ex) {
throw new VertexiumException("Could not deserialize: " + elementType + ":" + elementId, ex);
}
}
default T bytesToObject(Element sourceElement, byte[] bytes) {
try {
return bytesToObject(bytes);
} catch (Exception ex) {
throw new VertexiumException("Could not deserialize: " + sourceElement, ex);
}
}
default T bytesToObject(ExtendedDataRowId rowId, byte[] bytes) {
try {
return bytesToObject(bytes);
} catch (Exception ex) {
throw new VertexiumException("Could not deserialize: " + rowId, ex);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy