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

File WikiUserConfiguration.java

 

Coverage histogram

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

Code metrics

2
11
7
1
96
44
8
0.73
1.57
7
1.14

Classes

Class Line # Actions
WikiUserConfiguration 31 11 0% 8 4
0.880%
 

Contributing tests

This file is covered by 3 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.wiki.user;
21   
22    import org.apache.commons.lang3.builder.EqualsBuilder;
23    import org.apache.commons.lang3.builder.HashCodeBuilder;
24   
25    /**
26    * Configuration about the user management in a wiki.
27    *
28    * @since 5.3M2
29    * @version $Id: bc0a24f3a85182df18945e1d8f91181eae83a1e7 $
30    */
 
31    public class WikiUserConfiguration
32    {
33    private UserScope userScope;
34   
35    private MembershipType membershipType;
36   
37    /**
38    * Constructor.
39    */
 
40  96 toggle public WikiUserConfiguration()
41    {
42    // Default values
43  96 setUserScope(UserScope.GLOBAL_ONLY);
44  96 setMembershipType(MembershipType.INVITE);
45    }
46   
47    /**
48    * @return the user scope
49    */
 
50  66 toggle public UserScope getUserScope()
51    {
52  66 return userScope;
53    }
54   
55    /**
56    * @param scope the scope to set
57    */
 
58  160 toggle public void setUserScope(UserScope scope)
59    {
60  160 this.userScope = scope;
61    }
62   
63    /**
64    * @param type membership type to set
65    */
 
66  160 toggle public void setMembershipType(MembershipType type)
67    {
68  160 this.membershipType = type;
69    }
70   
71    /**
72    * @return the membership type of the wiki
73    */
 
74  36 toggle public MembershipType getMembershipType()
75    {
76  36 return membershipType;
77    }
78   
 
79  6 toggle @Override
80    public boolean equals(Object o)
81    {
82  6 if (!(o instanceof WikiUserConfiguration)) {
83  0 return false;
84    }
85   
86  6 WikiUserConfiguration otherConfig = (WikiUserConfiguration) o;
87  6 return new EqualsBuilder().append(this.membershipType, otherConfig.membershipType)
88    .append(this.userScope, otherConfig.userScope).isEquals();
89    }
90   
 
91  0 toggle @Override
92    public int hashCode()
93    {
94  0 return new HashCodeBuilder().append(this.membershipType).append(this.userScope).toHashCode();
95    }
96    }