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 schema diff, field by field. 025 * 026 * @author <a href="mailto:ataillefer@nuxeo.com">Antoine Taillefer</a> 027 */ 028public interface SchemaDiff extends Serializable { 029 030 /** 031 * Gets the schema diff. 032 * 033 * @return the schema diff 034 */ 035 Map<String, PropertyDiff> getSchemaDiff(); 036 037 /** 038 * Gets the field count. 039 * 040 * @return the field count 041 */ 042 int getFieldCount(); 043 044 /** 045 * Gets the field names as a list. 046 * 047 * @return the field names 048 */ 049 List<String> getFieldNames(); 050 051 /** 052 * Gets the field diff. 053 * 054 * @param field the field 055 * @return the field diff 056 */ 057 PropertyDiff getFieldDiff(String field); 058 059 /** 060 * Put field diff. 061 * 062 * @param field the field 063 * @param fieldDiff the field diff 064 * @return the property diff 065 */ 066 PropertyDiff putFieldDiff(String field, PropertyDiff fieldDiff); 067 068}