This project has retired. For details please refer to its Attic page.
RoleTemplate 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.List;
24  
25  /**
26   * @author Olivier Lamy
27   * @since 2.0
28   */
29  @XmlRootElement( name = "roleTemplate" )
30  public class RoleTemplate
31      implements Serializable
32  {
33      /**
34       * Field id
35       */
36      private String id;
37  
38      private String namePrefix;
39  
40      private String delimiter = " - ";
41  
42      private String description;
43  
44      private String resource;
45  
46      private List<String> roles;
47  
48      public RoleTemplate()
49      {
50          // no op
51      }
52  
53      public RoleTemplate( String id, String namePrefix, String delimiter, String description, String resource,
54                           List<String> roles )
55      {
56          this.id = id;
57          this.namePrefix = namePrefix;
58          this.delimiter = delimiter;
59          this.description = description;
60          this.resource = resource;
61          this.roles = roles;
62      }
63  
64      public String getId()
65      {
66          return id;
67      }
68  
69      public void setId( String id )
70      {
71          this.id = id;
72      }
73  
74      public String getNamePrefix()
75      {
76          return namePrefix;
77      }
78  
79      public void setNamePrefix( String namePrefix )
80      {
81          this.namePrefix = namePrefix;
82      }
83  
84      public String getDelimiter()
85      {
86          return delimiter;
87      }
88  
89      public void setDelimiter( String delimiter )
90      {
91          this.delimiter = delimiter;
92      }
93  
94      public String getDescription()
95      {
96          return description;
97      }
98  
99      public void setDescription( String description )
100     {
101         this.description = description;
102     }
103 
104     public String getResource()
105     {
106         return resource;
107     }
108 
109     public void setResource( String resource )
110     {
111         this.resource = resource;
112     }
113 
114     public List<String> getRoles()
115     {
116         return roles;
117     }
118 
119     public void setRoles( List<String> roles )
120     {
121         this.roles = roles;
122     }
123 
124     @Override
125     public String toString()
126     {
127         final StringBuilder sb = new StringBuilder();
128         sb.append( "RoleTemplate" );
129         sb.append( "{id='" ).append( id ).append( '\'' );
130         sb.append( ", namePrefix='" ).append( namePrefix ).append( '\'' );
131         sb.append( ", delimiter='" ).append( delimiter ).append( '\'' );
132         sb.append( ", description='" ).append( description ).append( '\'' );
133         sb.append( ", resource='" ).append( resource ).append( '\'' );
134         sb.append( ", roles=" ).append( roles );
135         sb.append( '}' );
136         return sb.toString();
137     }
138 }