@Override public int hashCode() { int result = 1; if ( model != null ) { result = PRIME * result + ( ( model.getGroupId() == null ) ? 0 : model.getGroupId().hashCode() ); result = PRIME * result + ( ( model.getArtifactId() == null ) ? 0 : model.getArtifactId().hashCode() ); result = PRIME * result + ( ( model.getVersion() == null ) ? 0 : model.getVersion().hashCode() ); result = PRIME * result + ( ( model.getClassifier() == null ) ? 0 : model.getClassifier().hashCode() ); result = PRIME * result + ( ( model.getType() == null ) ? 0 : model.getType().hashCode() ); } return result; }
model = new ArchivaArtifactModel(); model.setGroupId( groupId ); model.setArtifactId( artifactId ); model.setVersion( version ); model.setClassifier( StringUtils.defaultString( classifier ) ); model.setType( type ); model.setSnapshot( VersionUtil.isSnapshot( version ) ); model.setRepositoryId(repositoryId);
private boolean applyArtifactInfoFilters( ArtifactInfo artifactInfo, List<? extends ArtifactInfoFilter> artifactInfoFilters, Map<String, SearchResultHit> currentResult ) { if ( artifactInfoFilters == null || artifactInfoFilters.isEmpty() ) { return true; } ArchivaArtifactModel artifact = new ArchivaArtifactModel(); artifact.setArtifactId( artifactInfo.getArtifactId() ); artifact.setClassifier( artifactInfo.getClassifier() ); artifact.setGroupId( artifactInfo.getGroupId() ); artifact.setRepositoryId( artifactInfo.getRepository() ); artifact.setVersion( artifactInfo.getVersion() ); artifact.setChecksumMD5( artifactInfo.getMd5() ); artifact.setChecksumSHA1( artifactInfo.getSha1() ); for ( ArtifactInfoFilter filter : artifactInfoFilters ) { if ( !filter.addArtifactInResult( artifact, currentResult ) ) { return false; } } return true; }
public String getClassifier() { return model.getClassifier(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); if ( model.getGroupId() != null ) { sb.append( model.getGroupId() ); sb.append( ":" ); } appendArtifactTypeClassifierString( sb ); sb.append( ":" ); if ( model.getVersion() != null ) { sb.append( model.getVersion() ); } return sb.toString(); }
public String getArtifactId() { return model.getArtifactId(); }
public String getGroupId() { return model.getGroupId(); }
@Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } final ArchivaArtifact other = (ArchivaArtifact) obj; if ( model == null ) { if ( other.model != null ) { return false; } } if ( !model.equals( other.model ) ) { return false; } return true; }
model = new ArchivaArtifactModel(); model.setGroupId( groupId ); model.setArtifactId( artifactId ); model.setVersion( version ); model.setClassifier( StringUtils.defaultString( classifier ) ); model.setType( type ); model.setSnapshot( VersionUtil.isSnapshot( version ) ); model.setRepositoryId(repositoryId);
public String getClassifier() { return model.getClassifier(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); if ( model.getGroupId() != null ) { sb.append( model.getGroupId() ); sb.append( ":" ); } appendArtifactTypeClassifierString( sb ); sb.append( ":" ); if ( model.getVersion() != null ) { sb.append( model.getVersion() ); } return sb.toString(); }
public String getArtifactId() { return model.getArtifactId(); }
public String getGroupId() { return model.getGroupId(); }
@Override public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } final ArchivaArtifact other = (ArchivaArtifact) obj; if ( model == null ) { if ( other.model != null ) { return false; } } if ( !model.equals( other.model ) ) { return false; } return true; }
@Override public int hashCode() { int result = 1; if ( model != null ) { result = PRIME * result + ( ( model.getGroupId() == null ) ? 0 : model.getGroupId().hashCode() ); result = PRIME * result + ( ( model.getArtifactId() == null ) ? 0 : model.getArtifactId().hashCode() ); result = PRIME * result + ( ( model.getVersion() == null ) ? 0 : model.getVersion().hashCode() ); result = PRIME * result + ( ( model.getClassifier() == null ) ? 0 : model.getClassifier().hashCode() ); result = PRIME * result + ( ( model.getType() == null ) ? 0 : model.getType().hashCode() ); } return result; }
@Override public boolean addArtifactInResult( ArchivaArtifactModel artifact, Map<String, SearchResultHit> currentResult ) { return StringUtils.isBlank( artifact.getClassifier() ); } }
private void appendArtifactTypeClassifierString( StringBuilder sb ) { sb.append( model.getArtifactId() ); sb.append( ":" ); sb.append( getType() ); if ( hasClassifier() ) { sb.append( ":" ); sb.append( getClassifier() ); } }
/** * Method equals. * * @param other * @return boolean */ public boolean equals( Object other ) { if ( this == other ) { return true; } if ( !( other instanceof ArchivaArtifactModel ) ) { return false; } ArchivaArtifactModel that = (ArchivaArtifactModel) 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() ) ); result = result && ( getRepositoryId() == null ? that.getRepositoryId() == null : getRepositoryId().equals( that.getRepositoryId() ) ); return result; } //-- boolean equals( Object )
public boolean hasClassifier() { return StringUtils.isNotEmpty( model.getClassifier() ); }
private void appendArtifactTypeClassifierString( StringBuilder sb ) { sb.append( model.getArtifactId() ); sb.append( ":" ); sb.append( getType() ); if ( hasClassifier() ) { sb.append( ":" ); sb.append( getClassifier() ); } }