001package 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 021import java.io.Serializable; 022 023/** 024 * @author Olivier Lamy 025 * @since 1.4-M1 026 */ 027public 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 @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}