/** * Compares this metadata with the specified object. * * @param obj The object to compare this metadata against, may be {@code null}. * @return {@code true} if and only if the specified object is another {@link Metadata} with equal coordinates, * type, nature, properties and file, {@code false} otherwise. */ @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( !( obj instanceof Metadata ) ) { return false; } Metadata that = (Metadata) obj; return getArtifactId().equals( that.getArtifactId() ) && getGroupId().equals( that.getGroupId() ) && getVersion().equals( that.getVersion() ) && getType().equals( that.getType() ) && getNature().equals( that.getNature() ) && eq( getFile(), that.getFile() ) && eq( getProperties(), that.getProperties() ); }
/** * Returns a hash code for this metadata. * * @return A hash code for the metadata. */ @Override public int hashCode() { int hash = 17; hash = hash * 31 + getGroupId().hashCode(); hash = hash * 31 + getArtifactId().hashCode(); hash = hash * 31 + getType().hashCode(); hash = hash * 31 + getNature().hashCode(); hash = hash * 31 + getVersion().hashCode(); hash = hash * 31 + hash( getFile() ); return hash; }
/** * Compares this metadata with the specified object. * * @param obj The object to compare this metadata against, may be {@code null}. * @return {@code true} if and only if the specified object is another {@link Metadata} with equal coordinates, * type, nature, properties and file, {@code false} otherwise. */ @Override public boolean equals( Object obj ) { if ( obj == this ) { return true; } else if ( !( obj instanceof Metadata ) ) { return false; } Metadata that = (Metadata) obj; return getArtifactId().equals( that.getArtifactId() ) && getGroupId().equals( that.getGroupId() ) && getVersion().equals( that.getVersion() ) && getType().equals( that.getType() ) && getNature().equals( that.getNature() ) && eq( getFile(), that.getFile() ) && eq( getProperties(), that.getProperties() ); }
/** * Returns a hash code for this metadata. * * @return A hash code for the metadata. */ @Override public int hashCode() { int hash = 17; hash = hash * 31 + getGroupId().hashCode(); hash = hash * 31 + getArtifactId().hashCode(); hash = hash * 31 + getType().hashCode(); hash = hash * 31 + getNature().hashCode(); hash = hash * 31 + getVersion().hashCode(); hash = hash * 31 + hash( getFile() ); return hash; }
private RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, Metadata.Nature nature ) { boolean releases = !Metadata.Nature.SNAPSHOT.equals( nature ); boolean snapshots = !Metadata.Nature.RELEASE.equals( nature ); return remoteRepositoryManager.getPolicy( session, repository, releases, snapshots ); }
private RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, Metadata.Nature nature ) { boolean releases = !Metadata.Nature.SNAPSHOT.equals( nature ); boolean snapshots = !Metadata.Nature.RELEASE.equals( nature ); return remoteRepositoryManager.getPolicy( session, repository, releases, snapshots ); }
private boolean isEnabled( RemoteRepository repository, Metadata.Nature nature ) { if ( !Metadata.Nature.SNAPSHOT.equals( nature ) && repository.getPolicy( false ).isEnabled() ) { return true; } if ( !Metadata.Nature.RELEASE.equals( nature ) && repository.getPolicy( true ).isEnabled() ) { return true; } return false; }
private RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, Metadata.Nature nature ) { boolean releases = !Metadata.Nature.SNAPSHOT.equals( nature ); boolean snapshots = !Metadata.Nature.RELEASE.equals( nature ); return remoteRepositoryManager.getPolicy( session, repository, releases, snapshots ); }
private boolean isEnabled( RemoteRepository repository, Metadata.Nature nature ) { if ( !Metadata.Nature.SNAPSHOT.equals( nature ) && repository.getPolicy( false ).isEnabled() ) { return true; } if ( !Metadata.Nature.RELEASE.equals( nature ) && repository.getPolicy( true ).isEnabled() ) { return true; } return false; }
private RepositoryPolicy getPolicy( RepositorySystemSession session, RemoteRepository repository, Metadata.Nature nature ) { boolean releases = !Metadata.Nature.SNAPSHOT.equals( nature ); boolean snapshots = !Metadata.Nature.RELEASE.equals( nature ); return remoteRepositoryManager.getPolicy( session, repository, releases, snapshots ); }