001    package org.apache.archiva.admin.model.beans;
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    
021    import java.io.Serializable;
022    
023    /**
024     * @author Olivier Lamy
025     * @since 1.4-M1
026     */
027    public class AbstractRepository
028        implements Serializable
029    {
030    
031        private String id;
032    
033        private String name;
034    
035        private String layout = "default";
036    
037        private String indexDirectory;
038    
039        /**
040         * @since 1.4-M3
041         */
042        private String description;
043    
044        public AbstractRepository()
045        {
046            // no op
047        }
048    
049        public AbstractRepository( String id, String name, String layout )
050        {
051            this.id = id;
052            this.name = name;
053            this.layout = layout;
054        }
055    
056        public String getId()
057        {
058            return id;
059        }
060    
061        public void setId( String id )
062        {
063            this.id = id;
064        }
065    
066        public String getName()
067        {
068            return name;
069        }
070    
071        public void setName( String name )
072        {
073            this.name = name;
074        }
075    
076        public String getLayout()
077        {
078            return layout;
079        }
080    
081        public void setLayout( String layout )
082        {
083            this.layout = layout;
084        }
085    
086    
087    
088        public String getIndexDirectory()
089        {
090            return indexDirectory;
091        }
092    
093        public void setIndexDirectory( String indexDirectory )
094        {
095            this.indexDirectory = indexDirectory;
096        }
097    
098        public String getDescription()
099        {
100            return description;
101        }
102    
103        public void setDescription( String description )
104        {
105            this.description = description;
106        }
107    
108        public int hashCode()
109        {
110            int result = 17;
111            result = 37 * result + ( id != null ? id.hashCode() : 0 );
112            return result;
113        }
114    
115        public boolean equals( Object other )
116        {
117            if ( this == other )
118            {
119                return true;
120            }
121    
122            if ( !( other instanceof AbstractRepository ) )
123            {
124                return false;
125            }
126    
127            AbstractRepository that = (AbstractRepository) other;
128            boolean result = true;
129            result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
130            return result;
131        }
132    
133        @Override
134        public String toString()
135        {
136            final StringBuilder sb = new StringBuilder();
137            sb.append( "AbstractRepository" );
138            sb.append( "{id='" ).append( id ).append( '\'' );
139            sb.append( ", name='" ).append( name ).append( '\'' );
140            sb.append( ", layout='" ).append( layout ).append( '\'' );
141            sb.append( ", indexDirectory='" ).append( indexDirectory ).append( '\'' );
142            sb.append( ", description='" ).append( description ).append( '\'' );
143            sb.append( '}' );
144            return sb.toString();
145        }
146    }