1 package org.apache.maven.archiva.indexer.bytecode;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord;
23 import org.apache.maven.archiva.model.ArchivaArtifact;
25 import java.util.List;
28 * Lucene Record for Bytecode information.
30 * @author <a href="mailto:joakime@apache.org">Joakim Erdfelt</a>
33 public class BytecodeRecord
34 implements LuceneRepositoryContentRecord
36 private String repositoryId;
38 private ArchivaArtifact artifact;
40 private String filename;
48 public ArchivaArtifact getArtifact()
53 public List getClasses()
58 public List getFiles()
63 public List getMethods()
68 public String getRepositoryId()
73 public String getPrimaryKey()
75 StringBuffer id = new StringBuffer();
76 id.append( artifact.getGroupId() ).append( ":" );
77 id.append( artifact.getArtifactId() ).append( ":" );
78 id.append( artifact.getVersion() );
80 if ( artifact.getClassifier() != null )
82 id.append( ":" ).append( artifact.getClassifier() );
85 id.append( ":" ).append( artifact.getType() );
90 public void setArtifact( ArchivaArtifact artifact )
92 this.artifact = artifact;
95 public void setClasses( List classes )
97 this.classes = classes;
100 public void setFiles( List files )
105 public void setMethods( List methods )
107 this.methods = methods;
110 public void setRepositoryId( String repositoryId )
112 this.repositoryId = repositoryId;
115 public int hashCode()
117 final int PRIME = 31;
119 result = PRIME * result + ( ( artifact == null ) ? 0 : artifact.hashCode() );
123 public boolean equals( Object obj )
135 if ( getClass() != obj.getClass() )
140 final BytecodeRecord other = (BytecodeRecord) obj;
142 if ( artifact == null )
144 if ( other.artifact != null )
149 else if ( !artifact.equals( other.artifact ) )
157 public String getFilename()
162 public void setFilename( String filename )
164 this.filename = filename;
167 public String toString()
169 StringBuffer sb = new StringBuffer();
171 sb.append( "BytecodeRecord[" );
172 sb.append( "artifact=" ).append( artifact );
173 sb.append( ",filename=" ).append( filename );
175 return sb.toString();