1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package org.xwiki.diff.internal

File DefaultDiffResult.java

 

Coverage histogram

../../../../img/srcFileCovDistChart8.png
54% of files have more coverage

Code metrics

0
8
7
1
103
46
7
0.88
1.14
7
1

Classes

Class Line # Actions
DefaultDiffResult 34 8 0% 7 4
0.7333333573.3%
 

Contributing tests

This file is covered by 59 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package org.xwiki.diff.internal;
21   
22    import java.util.List;
23   
24    import org.xwiki.diff.DiffResult;
25    import org.xwiki.diff.Patch;
26    import org.xwiki.logging.LogQueue;
27   
28    /**
29    * Default implementation of {@link DiffResult}.
30    *
31    * @param <E> the type of compared elements
32    * @version $Id: 93c4cbfe6abd2aec6c6318c423b1e045a33f9f09 $
33    */
 
34    public class DefaultDiffResult<E> implements DiffResult<E>
35    {
36    /**
37    * @see #getPrevious()
38    */
39    private List<E> previous;
40   
41    /**
42    * @see #getNext()
43    */
44    private List<E> next;
45   
46    /**
47    * @see #getLog()
48    */
49    private LogQueue log = new LogQueue();
50   
51    /**
52    * @see #getPatch()
53    */
54    private Patch<E> patch;
55   
56    /**
57    * @param previous the list before the modification
58    * @param next the list after the modification
59    */
 
60  310 toggle public DefaultDiffResult(List<E> previous, List<E> next)
61    {
62  310 this.previous = previous;
63  310 this.next = next;
64    }
65   
 
66  0 toggle @Override
67    public List<E> getNext()
68    {
69  0 return this.next;
70    }
71   
 
72  48 toggle @Override
73    public List<E> getPrevious()
74    {
75  48 return this.previous;
76    }
77   
 
78  248 toggle @Override
79    public LogQueue getLog()
80    {
81  248 return this.log;
82    }
83   
 
84  317 toggle @Override
85    public Patch<E> getPatch()
86    {
87  317 return this.patch;
88    }
89   
90    /**
91    * @param patch the patch
92    */
 
93  310 toggle public void setPatch(Patch<E> patch)
94    {
95  310 this.patch = patch;
96    }
97   
 
98  0 toggle @Override
99    public String toString()
100    {
101  0 return this.patch.toString();
102    }
103    }