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

File WikiCopiedEvent.java

 

Coverage histogram

../../../../img/srcFileCovDistChart10.png
0% of files have more coverage

Code metrics

2
9
5
1
98
32
6
0.67
1.8
5
1.2

Classes

Class Line # Actions
WikiCopiedEvent 35 9 0% 6 1
0.937593.8%
 

Contributing tests

This file is covered by 6 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.bridge.event;
21   
22    /**
23    * An event triggered after a wiki has been copied.
24    * <p>
25    * The event also send the following parameters:
26    * </p>
27    * <ul>
28    * <li>source: the source wiki identifier as {@link String}</li>
29    * <li>data: the current {com.xpn.xwiki.XWikiContext} instance</li>
30    * </ul>
31    *
32    * @version $Id: 55de3f2699f6abce9b0acd8c348bcf82aa4429e9 $
33    * @since 4.3M1
34    */
 
35    public class WikiCopiedEvent extends AbstractWikiEvent
36    {
37    /**
38    * The version identifier for this Serializable class. Increment only if the <i>serialized</i> form of the class
39    * changes.
40    */
41    private static final long serialVersionUID = 1L;
42   
43    /**
44    * The wiki where the documents have been copied.
45    */
46    private String targetWikiId;
47   
48    /**
49    * Matches all {@link WikiCopiedEvent} events.
50    */
 
51  27 toggle public WikiCopiedEvent()
52    {
53   
54    }
55   
56    /**
57    * Matches events affecting the same wikis.
58    *
59    * @param sourceWikiId the source wiki identifier
60    * @param targetWikiId the target wiki identifier
61    */
 
62  7 toggle public WikiCopiedEvent(String sourceWikiId, String targetWikiId)
63    {
64  7 super(sourceWikiId);
65   
66  7 this.targetWikiId = targetWikiId;
67    }
68   
 
69  5 toggle @Override
70    public boolean matches(Object otherEvent)
71    {
72  5 boolean matches = super.matches(otherEvent);
73   
74  5 if (matches) {
75  5 WikiCopiedEvent wikiCopiedEvent = (WikiCopiedEvent) otherEvent;
76   
77  5 matches = getTargetWikiId() == null || getTargetWikiId().equals(wikiCopiedEvent.getTargetWikiId());
78    }
79   
80  5 return matches;
81    }
82   
83    /**
84    * @return the source wiki identifier
85    */
 
86  5 toggle public String getSourceWikiId()
87    {
88  5 return getWikiId();
89    }
90   
91    /**
92    * @return the target wiki identifier
93    */
 
94  10 toggle public String getTargetWikiId()
95    {
96  10 return this.targetWikiId;
97    }
98    }