1 package org.apache.archiva.admin.model.beans;
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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
21 import javax.xml.bind.annotation.XmlRootElement;
22 import java.io.Serializable;
23 import java.util.ArrayList;
24 import java.util.List;
27 * @author Olivier Lamy
30 @XmlRootElement(name = "repositoryGroup")
31 public class RepositoryGroup
32 implements Serializable
42 private List<String> repositories;
45 * The path of the merged index.
47 private String mergedIndexPath = "/.indexer";
49 public RepositoryGroup()
54 public RepositoryGroup( String id, List<String> repositories )
57 this.repositories = repositories;
61 * Method addRepository.
65 public void addRepository( String string )
67 getRepositories().add( string );
71 * Get the id of the repository group.
81 * Method getRepositories.
85 public List<String> getRepositories()
87 if ( this.repositories == null )
89 this.repositories = new ArrayList<String>( 0 );
92 return this.repositories;
96 * Method removeRepository.
100 public void removeRepository( String string )
102 getRepositories().remove( string );
106 * Set the id of the repository group.
110 public void setId( String id )
116 * Set the list of repository ids under the group.
118 * @param repositories
120 public void setRepositories( List<String> repositories )
122 this.repositories = repositories;
125 public String getMergedIndexPath()
127 return mergedIndexPath;
130 public void setMergedIndexPath( String mergedIndexPath )
132 this.mergedIndexPath = mergedIndexPath;
135 public RepositoryGroup mergedIndexPath( String mergedIndexPath )
137 this.mergedIndexPath = mergedIndexPath;
141 public boolean equals( Object other )
148 if ( !( other instanceof RepositoryGroup ) )
153 RepositoryGroup that = (RepositoryGroup) other;
154 boolean result = true;
155 result = result && ( getId() == null ? that.getId() == null : getId().equals( that.getId() ) );
159 public int hashCode()
162 result = 37 * result + ( id != null ? id.hashCode() : 0 );
167 public String toString()
169 final StringBuilder sb = new StringBuilder();
170 sb.append( "RepositoryGroup" );
171 sb.append( "{id='" ).append( id ).append( '\'' );
172 sb.append( ", repositories=" ).append( repositories );
174 return sb.toString();