001/*
002 * (C) Copyright 2012 Nuxeo SA (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     ataillefer
016 */
017package org.nuxeo.ecm.diff.model;
018
019import java.io.Serializable;
020import java.util.List;
021import java.util.Map;
022
023/**
024 * Representation of a document diff, schema by schema and field by field.
025 * 
026 * @author <a href="mailto:ataillefer@nuxeo.com">Antoine Taillefer</a>
027 */
028public interface DocumentDiff extends Serializable {
029
030    /**
031     * Gets the doc diff.
032     * 
033     * @return the doc diff
034     */
035    Map<String, SchemaDiff> getDocDiff();
036
037    /**
038     * Gets the schema count.
039     * 
040     * @return the schema count
041     */
042    int getSchemaCount();
043
044    /**
045     * Checks if the doc diff is empty.
046     * 
047     * @return true, if is empty
048     */
049    boolean isDocDiffEmpty();
050
051    /**
052     * Gets the schema names as a list.
053     * 
054     * @return the schema names
055     */
056    List<String> getSchemaNames();
057
058    /**
059     * Gets the schema diff.
060     * 
061     * @param schema the schema
062     * @return the schema diff
063     */
064    SchemaDiff getSchemaDiff(String schema);
065
066    /**
067     * Inits schema diff.
068     * 
069     * @param schema the schema
070     * @return the map
071     */
072    SchemaDiff initSchemaDiff(String schema);
073
074}