From: Olivier Lamy Date: Tue, 13 Sep 2011 12:02:36 +0000 (+0000) Subject: format cleanup : no code change X-Git-Tag: archiva-1.4-M1~326 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=7a01429a4423cc5f064b7690c6abf493496a02a7;p=archiva.git format cleanup : no code change git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1170131 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java index 251c5ea8c..a98585291 100644 --- a/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java +++ b/archiva-modules/archiva-web/archiva-rest/archiva-rest-api/src/main/java/org/apache/archiva/rest/api/model/Artifact.java @@ -40,74 +40,16 @@ public class Artifact public Artifact() { - - } - - @Override - public boolean equals( Object o ) - { - if ( this == o ) - { - return true; - } - if ( o == null || getClass() != o.getClass() ) - { - return false; - } - - Artifact artifact = (Artifact) o; - - if ( !artifactId.equals( artifact.artifactId ) ) - { - return false; - } - if ( !groupId.equals( artifact.groupId ) ) - { - return false; - } - if ( !repositoryId.equals( artifact.repositoryId ) ) - { - return false; - } - if ( type != null ? !type.equals( artifact.type ) : artifact.type != null ) - { - return false; - } - if ( !version.equals( artifact.version ) ) - { - return false; - } - - return true; - } - - @Override - public int hashCode() - { - int result = repositoryId.hashCode(); - result = 31 * result + groupId.hashCode(); - result = 31 * result + artifactId.hashCode(); - result = 31 * result + version.hashCode(); - result = 31 * result + ( type != null ? type.hashCode() : 0 ); - return result; - } - - @Override - public String toString() - { - return "Artifact{" + "repositoryId='" + repositoryId + '\'' + ", groupId='" + groupId + '\'' + ", artifactId='" - + artifactId + '\'' + ", version='" + version + '\'' + ", type='" + type + '\'' + '}'; + // no op } public Artifact( String repositoryId, String groupId, String artifactId, String version, String type ) -// String type, Date whenGathered ) { this.repositoryId = repositoryId; this.groupId = groupId; this.artifactId = artifactId; this.version = version; this.type = type; - //this.whenGathered = whenGathered; } public String getGroupId() @@ -135,11 +77,6 @@ public class Artifact return repositoryId; } - /*public Date getWhenGathered() - { - return whenGathered; - }*/ - public void setGroupId( String groupId ) { this.groupId = groupId; @@ -165,9 +102,67 @@ public class Artifact this.repositoryId = repositoryId; } - /*@ServiceBeanField( "whenGathered" ) - public void setWhenGathered( Date whenGathered ) + @Override + public boolean equals( Object o ) { - this.whenGathered = whenGathered; - }*/ + if ( this == o ) + { + return true; + } + if ( o == null || getClass() != o.getClass() ) + { + return false; + } + + Artifact artifact = (Artifact) o; + + if ( !artifactId.equals( artifact.artifactId ) ) + { + return false; + } + if ( !groupId.equals( artifact.groupId ) ) + { + return false; + } + if ( !repositoryId.equals( artifact.repositoryId ) ) + { + return false; + } + if ( type != null ? !type.equals( artifact.type ) : artifact.type != null ) + { + return false; + } + if ( !version.equals( artifact.version ) ) + { + return false; + } + + return true; + } + + @Override + public int hashCode() + { + int result = repositoryId.hashCode(); + result = 31 * result + groupId.hashCode(); + result = 31 * result + artifactId.hashCode(); + result = 31 * result + version.hashCode(); + result = 31 * result + ( type != null ? type.hashCode() : 0 ); + return result; + } + + @Override + public String toString() + { + final StringBuilder sb = new StringBuilder(); + sb.append( "Artifact" ); + sb.append( "{repositoryId='" ).append( repositoryId ).append( '\'' ); + sb.append( ", groupId='" ).append( groupId ).append( '\'' ); + sb.append( ", artifactId='" ).append( artifactId ).append( '\'' ); + sb.append( ", version='" ).append( version ).append( '\'' ); + sb.append( ", type='" ).append( type ).append( '\'' ); + sb.append( '}' ); + return sb.toString(); + } + }