/** * Method equals * * @param other */ public boolean equals(Object other) { if ( this == other) { return true; } if ( !(other instanceof ArchivaArtifactJavaDetails) ) { return false; } ArchivaArtifactJavaDetails that = (ArchivaArtifactJavaDetails) other; boolean result = true; result = result && ( getGroupId() == null ? that.getGroupId() == null : getGroupId().equals( that.getGroupId() ) ); result = result && ( getArtifactId() == null ? that.getArtifactId() == null : getArtifactId().equals( that.getArtifactId() ) ); result = result && ( getVersion() == null ? that.getVersion() == null : getVersion().equals( that.getVersion() ) ); result = result && ( getClassifier() == null ? that.getClassifier() == null : getClassifier().equals( that.getClassifier() ) ); result = result && ( getType() == null ? that.getType() == null : getType().equals( that.getType() ) ); return result; } //-- boolean equals(Object)
public static ArchivaArtifactJavaDetails getJavaDetails( ArchivaArtifact artifact ) { ArchivaArtifactJavaDetails javaDetails = (ArchivaArtifactJavaDetails) artifact.getPlatformDetails(); if ( javaDetails == null ) { javaDetails = new ArchivaArtifactJavaDetails(); artifact.setPlatformDetails( javaDetails ); } return javaDetails; } }
public LuceneRepositoryContentRecord convert( Document document ) throws ParseException { BytecodeRecord record = new BytecodeRecord(); record.setRepositoryId( document.get( LuceneDocumentMaker.REPOSITORY_ID ) ); // Artifact Reference String groupId = document.get( ArtifactKeys.GROUPID ); String artifactId = document.get( ArtifactKeys.ARTIFACTID ); String version = document.get( ArtifactKeys.VERSION ); String classifier = document.get( ArtifactKeys.CLASSIFIER ); String type = document.get( ArtifactKeys.TYPE ); ArchivaArtifact artifact = new ArchivaArtifact( groupId, artifactId, version, classifier, type ); record.setArtifact( artifact ); // Bytecode Specifics JavaArtifactHelper.getJavaDetails( record.getArtifact() ).setJdk( document.get( BytecodeKeys.JDK ) ); record.setClasses( getList( document, BytecodeKeys.CLASSES ) ); record.setMethods( getList( document, BytecodeKeys.METHODS ) ); record.setFiles( getList( document, BytecodeKeys.FILES ) ); return record; }
public Document convert( LuceneRepositoryContentRecord record ) { if ( !( record instanceof BytecodeRecord ) ) { throw new ClassCastException( "Unable to convert type " + record.getClass().getName() + " to " + BytecodeRecord.class.getName() + "." ); } BytecodeRecord bytecode = (BytecodeRecord) record; LuceneDocumentMaker doc = new LuceneDocumentMaker( bytecode ); // Artifact Reference doc.addFieldTokenized( ArtifactKeys.GROUPID, bytecode.getArtifact().getGroupId() ); doc.addFieldExact( ArtifactKeys.GROUPID_EXACT, bytecode.getArtifact().getGroupId() ); doc.addFieldTokenized( ArtifactKeys.ARTIFACTID, bytecode.getArtifact().getArtifactId() ); doc.addFieldExact( ArtifactKeys.ARTIFACTID_EXACT, bytecode.getArtifact().getArtifactId() ); doc.addFieldTokenized( ArtifactKeys.VERSION, bytecode.getArtifact().getVersion() ); doc.addFieldExact( ArtifactKeys.VERSION_EXACT, bytecode.getArtifact().getVersion() ); doc.addFieldTokenized( ArtifactKeys.TYPE, bytecode.getArtifact().getType() ); doc.addFieldUntokenized( ArtifactKeys.CLASSIFIER, bytecode.getArtifact().getClassifier() ); // Bytecode Specifics doc.addFieldExact( BytecodeKeys.JDK, JavaArtifactHelper.getJavaDetails( bytecode.getArtifact() ).getJdk() ); doc.addFieldTokenized( BytecodeKeys.CLASSES, bytecode.getClasses() ); doc.addFieldTokenized( BytecodeKeys.METHODS, bytecode.getMethods() ); doc.addFieldTokenized( BytecodeKeys.FILES, bytecode.getFiles() ); return doc.getDocument(); }
/** * Method toString */ public java.lang.String toString() { StringBuffer buf = new StringBuffer(); buf.append( "groupId = '" ); buf.append( getGroupId() + "'" ); buf.append( "\n" ); buf.append( "artifactId = '" ); buf.append( getArtifactId() + "'" ); buf.append( "\n" ); buf.append( "version = '" ); buf.append( getVersion() + "'" ); buf.append( "\n" ); buf.append( "classifier = '" ); buf.append( getClassifier() + "'" ); buf.append( "\n" ); buf.append( "type = '" ); buf.append( getType() + "'" ); return buf.toString(); } //-- java.lang.String toString()