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

File FilterElementParameterDescriptor.java

 

Coverage histogram

../../../img/srcFileCovDistChart7.png
64% of files have more coverage

Code metrics

0
13
6
1
114
41
6
0.46
2.17
6
1

Classes

Class Line # Actions
FilterElementParameterDescriptor 31 13 0% 6 6
0.6842105468.4%
 

Contributing tests

This file is covered by 692 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.filter;
21   
22    import java.lang.reflect.Type;
23   
24    /**
25    * A filter element parameter.
26    *
27    * @param <T> the type of the parameter
28    * @version $Id: 7601aff5efc3c5a64687bfd2acd707557091134e $
29    * @since 5.2M1
30    */
 
31    public class FilterElementParameterDescriptor<T>
32    {
33    /**
34    * @see #getIndex()
35    */
36    private int index;
37   
38    /**
39    * @see #getName()
40    */
41    private String name;
42   
43    /**
44    * @see #getType()
45    */
46    private Type type;
47   
48    /**
49    * @see #getDefaultValue()
50    */
51    private T defaultValue;
52   
53    /**
54    * @param index the index of the parameter.
55    * @param name the name of the parameter. {@code null} if no {@link org.xwiki.filter.annotation.Name} annotation has
56    * been used.
57    * @param type the type of the parameter.
58    * @param defaultValue the default value.
59    */
 
60  47201 toggle public FilterElementParameterDescriptor(int index, String name, Type type, T defaultValue)
61    {
62  47201 this.index = index;
63  47201 this.name = name;
64  47201 this.type = type;
65  47200 this.defaultValue = defaultValue;
66    }
67   
68    /**
69    * @return the index of the parameter.
70    */
 
71  52164 toggle public int getIndex()
72    {
73  52164 return this.index;
74    }
75   
76    /**
77    * @return the name of the parameter. {@code null} if no {@link org.xwiki.filter.annotation.Name} annotation has
78    * been used.
79    */
 
80  109703 toggle public String getName()
81    {
82  109704 return this.name;
83    }
84   
85    /**
86    * @return the type of the parameter.
87    */
 
88  29572 toggle public Type getType()
89    {
90  29572 return this.type;
91    }
92   
93    /**
94    * @return the default value.
95    */
 
96  34282 toggle public T getDefaultValue()
97    {
98  34282 return this.defaultValue;
99    }
100   
 
101  0 toggle @Override
102    public String toString()
103    {
104  0 StringBuilder builder = new StringBuilder();
105   
106  0 builder.append(getName());
107   
108  0 builder.append(':');
109   
110  0 builder.append(getType());
111   
112  0 return builder.toString();
113    }
114    }