001/* 002 * (C) Copyright 2012 Nuxeo SA (http://nuxeo.com/) and others. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 * 016 * Contributors: 017 * ataillefer 018 */ 019package org.nuxeo.ecm.diff.model; 020 021import java.io.Serializable; 022import java.util.List; 023import java.util.Map; 024 025/** 026 * Representation of a document diff, schema by schema and field by field. 027 * 028 * @author <a href="mailto:[email protected]">Antoine Taillefer</a> 029 */ 030public interface DocumentDiff extends Serializable { 031 032 /** 033 * Gets the doc diff. 034 * 035 * @return the doc diff 036 */ 037 Map<String, SchemaDiff> getDocDiff(); 038 039 /** 040 * Gets the schema count. 041 * 042 * @return the schema count 043 */ 044 int getSchemaCount(); 045 046 /** 047 * Checks if the doc diff is empty. 048 * 049 * @return true, if is empty 050 */ 051 boolean isDocDiffEmpty(); 052 053 /** 054 * Gets the schema names as a list. 055 * 056 * @return the schema names 057 */ 058 List<String> getSchemaNames(); 059 060 /** 061 * Gets the schema diff. 062 * 063 * @param schema the schema 064 * @return the schema diff 065 */ 066 SchemaDiff getSchemaDiff(String schema); 067 068 /** 069 * Inits schema diff. 070 * 071 * @param schema the schema 072 * @return the map 073 */ 074 SchemaDiff initSchemaDiff(String schema); 075 076}