1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.eventstream.internal

File DefaultUntypedRecordableEvent.java

 

Coverage histogram

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

Code metrics

0
9
6
1
83
40
6
0.67
1.5
6
1

Classes

Class Line # Actions
DefaultUntypedRecordableEvent 34 9 0% 6 0
1.0100%
 

Contributing tests

This file is covered by 10 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.eventstream.internal;
21   
22    import java.util.Collections;
23    import java.util.Set;
24   
25    import org.xwiki.eventstream.TargetableEvent;
26    import org.xwiki.eventstream.UntypedRecordableEvent;
27   
28    /**
29    * Default implementation of the {@link UntypedRecordableEvent} interface.
30    *
31    * @version $Id: c37d1ef699144c73ccc02fecce1aec6c9ba5bdab $
32    * @since 9.6RC1
33    */
 
34    public class DefaultUntypedRecordableEvent implements UntypedRecordableEvent, TargetableEvent
35    {
36    private String eventType;
37   
38    private Set<String> target;
39   
 
40  8 toggle DefaultUntypedRecordableEvent(String eventType)
41    {
42  8 this.eventType = eventType;
43  8 this.target = Collections.emptySet();
44    }
45   
 
46  3 toggle DefaultUntypedRecordableEvent()
47    {
48  3 this.eventType = "";
49  3 this.target = Collections.emptySet();
50    }
51   
52    /**
53    * Construct a DefaultUntypedRecordableEvent.
54    * @param eventType event type
55    * @param target list of target (can't be null !)
56    *
57    * @since 9.11.2
58    * @since 10.0
59    */
 
60  5 toggle DefaultUntypedRecordableEvent(String eventType, Set<String> target)
61    {
62  5 this.eventType = eventType;
63  5 this.target = target;
64    }
65   
 
66  4 toggle @Override
67    public String getEventType()
68    {
69  4 return this.eventType;
70    }
71   
 
72  4 toggle @Override
73    public boolean matches(Object otherEvent)
74    {
75  4 return otherEvent != null && otherEvent instanceof UntypedRecordableEvent;
76    }
77   
 
78  8 toggle @Override
79    public Set<String> getTarget()
80    {
81  8 return this.target;
82    }
83    }