package anastore.store;

/**
 * A factory for a given storable type.
 */
public interface StorableFactory<D extends Storable>
{
    /**
     * Reconstruct the storable from its byte representation.  The
     * contents of the passed byte buffer is guaranteed to not change
     * in the future.
     *
     * @throws IllegalArgumentException if the byte representation is
     * not properly formed
     */
    public D fromData(byte[] data)
        throws IllegalArgumentException;
}
