archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1488961 - /archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/Project.java
Date Mon, 03 Jun 2013 11:47:56 GMT
Author: olamy
Date: Mon Jun  3 11:47:55 2013
New Revision: 1488961

URL: http://svn.apache.org/r1488961
Log:
make the constructor and fields more clear

Modified:
    archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/Project.java

Modified: archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/Project.java
URL: http://svn.apache.org/viewvc/archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/Project.java?rev=1488961&r1=1488960&r2=1488961&view=diff
==============================================================================
--- archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/Project.java
(original)
+++ archiva/sandbox/trunk/metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/Project.java
Mon Jun  3 11:47:55 2013
@@ -32,13 +32,14 @@ public class Project
     implements Serializable
 {
     @Id
-    @Column(name = "projectId")
+    @Column( name = "projectKey" )
+    private String projectKey;
+
+    @Column( name = "projectId" )
     private String projectId;
 
-    @Column(name = "id")
-    private String id;
 
-    @Column(name = "repository")
+    @Column( name = "repository" )
     private Namespace namespace;
 
     public Project()
@@ -46,21 +47,21 @@ public class Project
         // no op
     }
 
-    public Project( String projectId, String id, Namespace namespace )
+    public Project( String projectKey, String projectId, Namespace namespace )
     {
         this.projectId = projectId;
-        this.id = id;
+        this.projectKey = projectKey;
         this.namespace = namespace;
     }
 
-    public String getId()
+    public String getProjectKey()
     {
-        return id;
+        return projectKey;
     }
 
-    public void setId( String id )
+    public void setProjectKey( String projectKey )
     {
-        this.id = id;
+        this.projectKey = projectKey;
     }
 
     public Namespace getNamespace()
@@ -97,7 +98,7 @@ public class Project
 
         Project project = (Project) o;
 
-        if ( !id.equals( project.id ) )
+        if ( !projectKey.equals( project.projectKey ) )
         {
             return false;
         }
@@ -112,11 +113,22 @@ public class Project
     @Override
     public int hashCode()
     {
-        int result = id.hashCode();
+        int result = projectKey.hashCode();
         result = 31 * result + namespace.hashCode();
         return result;
     }
 
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder( "Project{" );
+        sb.append( "projectKey='" ).append( projectKey ).append( '\'' );
+        sb.append( ", projectId='" ).append( projectId ).append( '\'' );
+        sb.append( ", namespace=" ).append( namespace );
+        sb.append( '}' );
+        return sb.toString();
+    }
+
     public static class KeyBuilder
     {
 



Mime
View raw message