/** * 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; }
/** * 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 Metadata newInstance( Map<String, String> properties, File file ) { return new DefaultMetadata( getGroupId(), getArtifactId(), getVersion(), getType(), getNature(), file, properties ); }
private Metadata newInstance( Map<String, String> properties, File file ) { return new DefaultMetadata( getGroupId(), getArtifactId(), getVersion(), getType(), getNature(), file, properties ); }
/** * 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() ); }
/** * 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() ); }