This project has retired. For details please refer to its Attic page.
LdapGroupMapping xref
View Javadoc

1   package org.apache.archiva.redback.rest.api.model;
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 javax.xml.bind.annotation.XmlRootElement;
22  import java.io.Serializable;
23  import java.util.Collection;
24  import java.util.List;
25  
26  /**
27   * @author Olivier Lamy
28   * @since 2.1
29   */
30  @XmlRootElement(name = "ldapGroupMapping")
31  public class LdapGroupMapping
32      implements Serializable
33  {
34      private String group;
35  
36      private Collection<String> roleNames;
37  
38      public LdapGroupMapping()
39      {
40          // no op
41      }
42  
43      public LdapGroupMapping( String group, Collection<String> roleNames )
44      {
45          this.group = group;
46          this.roleNames = roleNames;
47      }
48  
49      public String getGroup()
50      {
51          return group;
52      }
53  
54      public void setGroup( String group )
55      {
56          this.group = group;
57      }
58  
59      public Collection<String> getRoleNames()
60      {
61          return roleNames;
62      }
63  
64      public void setRoleNames( Collection<String> roleNames )
65      {
66          this.roleNames = roleNames;
67      }
68  
69      @Override
70      public String toString()
71      {
72          final StringBuilder sb = new StringBuilder();
73          sb.append( "LdapGroupMapping" );
74          sb.append( "{group='" ).append( group ).append( '\'' );
75          sb.append( ", roleNames=" ).append( roleNames );
76          sb.append( '}' );
77          return sb.toString();
78      }
79  
80      @Override
81      public boolean equals( Object o )
82      {
83          if ( this == o )
84          {
85              return true;
86          }
87          if ( o == null || getClass() != o.getClass() )
88          {
89              return false;
90          }
91  
92          LdapGroupMapping that = (LdapGroupMapping) o;
93  
94          if ( !group.equals( that.group ) )
95          {
96              return false;
97          }
98  
99          return true;
100     }
101 
102     @Override
103     public int hashCode()
104     {
105         return group.hashCode();
106     }
107 }