1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package com.xpn.xwiki.criteria.impl

File RevisionCriteriaFactory.java

 

Coverage histogram

../../../../../img/srcFileCovDistChart2.png
81% of files have more coverage

Code metrics

0
7
8
1
110
38
8
1.14
0.88
8
1

Classes

Class Line # Actions
RevisionCriteriaFactory 22 7 0% 8 12
0.220%
 

Contributing tests

No tests hitting this source file were found.

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 com.xpn.xwiki.criteria.impl;
21   
 
22    public class RevisionCriteriaFactory
23    {
 
24  7 toggle public RevisionCriteriaFactory()
25    {
26    }
27   
28    /**
29    * Creates a default RevisionCriteria, the default criteria matches the versions created by any author, from January
30    * 1, 1970, 00:00:00 GMT (epoch) to the current date, minor versions aren't included.
31    */
 
32  0 toggle public RevisionCriteria createRevisionCriteria()
33    {
34  0 return new RevisionCriteria();
35    }
36   
37    /**
38    * Creates a revision criteria matching all the revisions created by the given author.
39    *
40    * @param author the author of the result set
41    * @return a new revision criteria
42    */
 
43  0 toggle public RevisionCriteria createRevisionCriteria(String author)
44    {
45  0 return new RevisionCriteria(author, PeriodFactory.createMaximumPeriod(),
46    RangeFactory.createAllRange(), false);
47    }
48   
49    /**
50    * Creates a revision criteria matching all the revisions created by the given author.
51    *
52    * @param author the author of the result set
53    * @param includeMinorVersions include minor versions in the set
54    * @return a new revision criteria
55    */
 
56  7 toggle public RevisionCriteria createRevisionCriteria(String author, boolean includeMinorVersions)
57    {
58  7 return new RevisionCriteria(author, PeriodFactory.createMaximumPeriod(),
59    RangeFactory.createAllRange(), includeMinorVersions);
60    }
61   
62    /**
63    * Creates a revision criteria matching the revisions created by any author, during the given period.
64    *
65    * @param period the time period during which the revisions has been created
66    * @return a new revision criteria
67    */
 
68  0 toggle public RevisionCriteria createRevisionCriteria(Period period)
69    {
70  0 return new RevisionCriteria("", period, RangeFactory.createAllRange(), false);
71    }
72   
73    /**
74    * Creates a revision criteria matching the revisions created by any author, during the given period.
75    *
76    * @param period the time period during which the revisions has been created
77    * @param includeMinorVersions include minor versions in the set
78    * @return a new revision criteria
79    */
 
80  0 toggle public RevisionCriteria createRevisionCriteria(Period period, boolean includeMinorVersions)
81    {
82  0 return new RevisionCriteria("", period, RangeFactory.createAllRange(), includeMinorVersions);
83    }
84   
85    /**
86    * Creates a revision criteria matching the revisions created by the given author, during the given period.
87    *
88    * @param author the author of the result set
89    * @param period the time period during which the revisions has been created
90    * @return a new revision criteria
91    */
 
92  0 toggle public RevisionCriteria createRevisionCriteria(String author, Period period)
93    {
94  0 return new RevisionCriteria(author, period, RangeFactory.createAllRange(), false);
95    }
96   
97    /**
98    * Creates a revision criteria matching the revisions created by the given author, during the given period.
99    *
100    * @param author the author of the result set
101    * @param period the time period during which the revisions has been created
102    * @param includeMinorVersions include minor versions in the set
103    * @return a new revision criteria
104    */
 
105  0 toggle public RevisionCriteria createRevisionCriteria(String author, Period period,
106    boolean includeMinorVersions)
107    {
108  0 return new RevisionCriteria(author, period, RangeFactory.createAllRange(), includeMinorVersions);
109    }
110    }