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.io.Serializable;
22  
23  /**
24   * @author Olivier Lamy
25   * @since 1.4-M1
26   */
27  public class AbstractRepository
28      implements Serializable
29  {
30  
31      private String id;
32  
33      private String name;
34  
35      private String layout = "default";
36  
37      private String indexDirectory;
38  
39      /**
40       * @since 1.4-M3
41       */
42      private String description;
43  
44      public AbstractRepository()
45      {
46          // no op
47      }
48  
49      public AbstractRepository( String id, String name, String layout )
50      {
51          this.id = id;
52          this.name = name;
53          this.layout = layout;
54      }
55  
56      public String getId()
57      {
58          return id;
59      }
60  
61      public void setId( String id )
62      {
63          this.id = id;
64      }
65  
66      public String getName()
67      {
68          return name;
69      }
70  
71      public void setName( String name )
72      {
73          this.name = name;
74      }
75  
76      public String getLayout()
77      {
78          return layout;
79      }
80  
81      public void setLayout( String layout )
82      {
83          this.layout = layout;
84      }
85  
86  
87  
88      public String getIndexDirectory()
89      {
90          return indexDirectory;
91      }
92  
93      public void setIndexDirectory( String indexDirectory )
94      {
95          this.indexDirectory = indexDirectory;
96      }
97  
98      public String getDescription()
99      {
100         return description;
101     }
102 
103     public void setDescription( String description )
104     {
105         this.description = description;
106     }
107 
108     @Override
109     public int hashCode()
110     {
111         int result = 17;
112         result = 37 * result + ( id != null ? id.hashCode() : 0 );
113         return result;
114     }
115 
116     @Override
117     public boolean equals( Object other )
118     {
119         if ( this == other )
120         {
121             return true;
122         }
123 
124         if ( !( other instanceof AbstractRepository ) )
125         {
126             return false;
127         }
128 
129         AbstractRepository that = (AbstractRepository) other;
130         boolean result = true;
131         result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
132         return result;
133     }
134 
135     @Override
136     public String toString()
137     {
138         final StringBuilder sb = new StringBuilder();
139         sb.append( "AbstractRepository" );
140         sb.append( "{id='" ).append( id ).append( '\'' );
141         sb.append( ", name='" ).append( name ).append( '\'' );
142         sb.append( ", layout='" ).append( layout ).append( '\'' );
143         sb.append( ", indexDirectory='" ).append( indexDirectory ).append( '\'' );
144         sb.append( ", description='" ).append( description ).append( '\'' );
145         sb.append( '}' );
146         return sb.toString();
147     }
148 }