ingo@100: /* ingo@100: * Copyright (c) 2010 by Intevation GmbH ingo@100: * ingo@100: * This program is free software under the LGPL (>=v2.1) ingo@100: * Read the file LGPL.txt coming with the software for details ingo@100: * or visit http://www.gnu.org/licenses/ if it does not exist. ingo@100: */ ingo@100: teichmann@475: package org.dive4elements.artifacts; sascha@41: sascha@41: /** sascha@41: * Interface to make artifact persistent. sascha@41: * sascha@77: * @author Sascha L. Teichmann sascha@41: */ sascha@41: public interface ArtifactSerializer sascha@41: { sascha@78: /** sascha@78: * Restores an artifact from an array of bytes. sascha@78: * @param bytes the persistent representation of the artifact. sascha@78: * @return The de-serialized artifact or null if there was an error. sascha@78: */ sascha@41: Artifact fromBytes(byte [] bytes); sascha@78: /** sascha@78: * Brings an artifact to a persistent form in form of a byte array. sascha@78: * @param artifact The artifact to be serialized. sascha@78: * @return the byte array representation of the artifact or null sascha@78: * if there was an error. sascha@78: */ sascha@41: byte [] toBytes(Artifact artifact); sascha@41: } sascha@85: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :