001package org.apache.archiva.redback.rest.api.model;
002/*
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements.  See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership.  The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License.  You may obtain a copy of the License at
010 *
011 *   http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing,
014 * software distributed under the License is distributed on an
015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 * KIND, either express or implied.  See the License for the
017 * specific language governing permissions and limitations
018 * under the License.
019 */
020
021import javax.xml.bind.annotation.XmlRootElement;
022import java.io.Serializable;
023import java.util.List;
024
025/**
026 * @author Olivier Lamy
027 * @since 2.0
028 */
029@XmlRootElement( name = "roleTemplate" )
030public class RoleTemplate
031    implements Serializable
032{
033    /**
034     * Field id
035     */
036    private String id;
037
038    private String namePrefix;
039
040    private String delimiter = " - ";
041
042    private String description;
043
044    private String resource;
045
046    private List<String> roles;
047
048    public RoleTemplate()
049    {
050        // no op
051    }
052
053    public RoleTemplate( String id, String namePrefix, String delimiter, String description, String resource,
054                         List<String> roles )
055    {
056        this.id = id;
057        this.namePrefix = namePrefix;
058        this.delimiter = delimiter;
059        this.description = description;
060        this.resource = resource;
061        this.roles = roles;
062    }
063
064    public String getId()
065    {
066        return id;
067    }
068
069    public void setId( String id )
070    {
071        this.id = id;
072    }
073
074    public String getNamePrefix()
075    {
076        return namePrefix;
077    }
078
079    public void setNamePrefix( String namePrefix )
080    {
081        this.namePrefix = namePrefix;
082    }
083
084    public String getDelimiter()
085    {
086        return delimiter;
087    }
088
089    public void setDelimiter( String delimiter )
090    {
091        this.delimiter = delimiter;
092    }
093
094    public String getDescription()
095    {
096        return description;
097    }
098
099    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}