
org.revenj.serialization.Serialization Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of revenj-core Show documentation
Show all versions of revenj-core Show documentation
DSL Platform compatible backend (https://dsl-platform.com)
The newest version!
package org.revenj.serialization;
import org.revenj.Utils;
import java.io.IOException;
import java.lang.reflect.Type;
public interface Serialization {
TFormat serialize(Type type, Object value) throws IOException;
default TFormat serialize(Object value) throws IOException {
return serialize(null, value);
}
Object deserialize(Type type, TFormat data) throws IOException;
@SuppressWarnings("unchecked")
default T deserialize(TFormat data, Class manifest) throws IOException {
return (T) deserialize(manifest, data);
}
@SuppressWarnings("unchecked")
default T deserialize(TFormat data, Class container, Type argument, Type... arguments) throws IOException {
return (T) deserialize(Utils.makeGenericType(container, argument, arguments), data);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy