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