001/* 002 * Copyright 2018 Anyware Services 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 */ 016package org.ametys.cms.content.compare; 017 018import org.ametys.cms.content.compare.ContentComparator.ChangeType; 019import org.ametys.cms.content.compare.ContentComparator.ChangeTypeDetail; 020 021/** 022 * One of the changes between 2 contents 023 */ 024public class ContentComparatorChange 025{ 026 private String _path; 027 private ChangeType _changeType; 028 private ChangeTypeDetail _changeTypeDetail; 029 030 /** 031 * Constructor with no details for this change 032 * @param path path of the metadata 033 * @param type type of change 034 */ 035 public ContentComparatorChange(String path, ChangeType type) 036 { 037 this(path, type, ChangeTypeDetail.NONE); 038 } 039 040 /** 041 * Constructor with change detail 042 * @param path path of the metadata 043 * @param type type of change 044 * @param detail detail of the change 045 */ 046 public ContentComparatorChange(String path, ChangeType type, ChangeTypeDetail detail) 047 { 048 this._path = path; 049 this._changeType = type; 050 this._changeTypeDetail = detail; 051 } 052 053 /** 054 * path of the change 055 * @return path of the change 056 */ 057 public String getPath() 058 { 059 return _path; 060 } 061 062 /** 063 * Type of change 064 * @return Type of change 065 */ 066 public ChangeType getChangeType() 067 { 068 return _changeType; 069 } 070 071 /** 072 * Detail of change 073 * @return Detail of change 074 */ 075 public ChangeTypeDetail getChangeTypeDetail() 076 { 077 return _changeTypeDetail; 078 } 079}