001package org.apache.archiva.configuration; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022/** 023 * The FileType object. 024 * 025 * @version $Revision$ $Date$ 026 */ 027@SuppressWarnings( "all" ) 028public class FileType 029 implements java.io.Serializable 030{ 031 032 //--------------------------/ 033 //- Class/Member Variables -/ 034 //--------------------------/ 035 036 /** 037 * Field id. 038 */ 039 private String id; 040 041 /** 042 * Field patterns. 043 */ 044 private java.util.List<String> patterns; 045 046 047 //-----------/ 048 //- Methods -/ 049 //-----------/ 050 051 /** 052 * Method addPattern. 053 * 054 * @param string 055 */ 056 public void addPattern( String string ) 057 { 058 getPatterns().add( string ); 059 } //-- void addPattern( String ) 060 061 /** 062 * Get the id field. 063 * 064 * @return String 065 */ 066 public String getId() 067 { 068 return this.id; 069 } //-- String getId() 070 071 /** 072 * Method getPatterns. 073 * 074 * @return List 075 */ 076 public java.util.List<String> getPatterns() 077 { 078 if ( this.patterns == null ) 079 { 080 this.patterns = new java.util.ArrayList<String>(); 081 } 082 083 return this.patterns; 084 } //-- java.util.List<String> getPatterns() 085 086 /** 087 * Method removePattern. 088 * 089 * @param string 090 */ 091 public void removePattern( String string ) 092 { 093 getPatterns().remove( string ); 094 } //-- void removePattern( String ) 095 096 /** 097 * Set the id field. 098 * 099 * @param id 100 */ 101 public void setId( String id ) 102 { 103 this.id = id; 104 } //-- void setId( String ) 105 106 /** 107 * Set the patterns field. 108 * 109 * @param patterns 110 */ 111 public void setPatterns( java.util.List<String> patterns ) 112 { 113 this.patterns = patterns; 114 } //-- void setPatterns( java.util.List ) 115 116 117 118 @Override 119 public boolean equals( Object o ) 120 { 121 if ( this == o ) 122 { 123 return true; 124 } 125 if ( o == null || getClass() != o.getClass() ) 126 { 127 return false; 128 } 129 130 FileType fileType = (FileType) o; 131 132 if ( id != null ? !id.equals( fileType.id ) : fileType.id != null ) 133 { 134 return false; 135 } 136 137 return true; 138 } 139 140 @Override 141 public int hashCode() 142 { 143 return id != null ? 37 + id.hashCode() : 0; 144 } 145 146}