This project has retired. For details please refer to its Attic page.
LdapGroupMapping xref
View Javadoc
1   package org.apache.archiva.admin.model.beans;
2   /*
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   * http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   */
20  
21  import java.util.Arrays;
22  import java.util.Collection;
23  
24  /**
25   * @author Olivier Lamy
26   * @since 1.4-M4
27   */
28  public class LdapGroupMapping
29  {
30      private String group;
31  
32      private Collection<String> roleNames;
33  
34      public LdapGroupMapping()
35      {
36          // no op
37      }
38  
39      public LdapGroupMapping( String group )
40      {
41          this.group = group;
42      }
43  
44      public LdapGroupMapping( String group, Collection<String> roleNames )
45      {
46          this.group = group;
47          this.roleNames = roleNames;
48      }
49  
50      public LdapGroupMapping( String group, String[] roleNames )
51      {
52          this.group = group;
53          if ( roleNames != null )
54          {
55              this.roleNames = Arrays.asList( roleNames );
56          }
57      }
58  
59      public String getGroup()
60      {
61          return group;
62      }
63  
64      public void setGroup( String group )
65      {
66          this.group = group;
67      }
68  
69      public Collection<String> getRoleNames()
70      {
71          return roleNames;
72      }
73  
74      public void setRoleNames( Collection<String> roleNames )
75      {
76          this.roleNames = roleNames;
77      }
78  
79      @Override
80      public boolean equals( Object o )
81      {
82          if ( this == o )
83          {
84              return true;
85          }
86          if ( o == null || getClass() != o.getClass() )
87          {
88              return false;
89          }
90  
91          LdapGroupMapping/../../../org/apache/archiva/admin/model/beans/LdapGroupMapping.html#LdapGroupMapping">LdapGroupMapping that = (LdapGroupMapping) o;
92  
93          if ( group != null ? !group.equals( that.group ) : that.group != null )
94          {
95              return false;
96          }
97  
98          return true;
99      }
100 
101     @Override
102     public int hashCode()
103     {
104         return group != null ? group.hashCode() : 0;
105     }
106 
107     @Override
108     public String toString()
109     {
110         return "LdapGroupMapping{" +
111             "group='" + group + '\'' +
112             ", roleNames=" + roleNames +
113             '}';
114     }
115 }