]> source.dussan.org Git - archiva.git/commitdiff
Adding toString methods to content items
authorMartin Stockhammer <martin_s@apache.org>
Sat, 21 Mar 2020 17:01:43 +0000 (18:01 +0100)
committerMartin Stockhammer <martin_s@apache.org>
Sat, 21 Mar 2020 17:01:43 +0000 (18:01 +0100)
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/base/ArchivaArtifact.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/base/ArchivaNamespace.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/base/ArchivaProject.java
archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/archiva/repository/content/base/ArchivaVersion.java

index b17a9c5afc56f997e1fe4413a131d047ed5fdd7f..d4d9ef2f5b207add9124cf3d1670356aeb5a1bbf 100644 (file)
@@ -159,6 +159,22 @@ public class ArchivaArtifact extends ArchivaContentItem implements Artifact
         return result;
     }
 
+    @Override
+    public String toString( )
+    {
+        final StringBuilder sb = new StringBuilder( "ArchivaArtifact{" );
+        sb.append( "id='" ).append( id ).append( '\'' );
+        sb.append( ", artifactVersion='" ).append( artifactVersion ).append( '\'' );
+        sb.append( ", version=" ).append( version );
+        sb.append( ", type='" ).append( type ).append( '\'' );
+        sb.append( ", classifier='" ).append( classifier ).append( '\'' );
+        sb.append( ", remainder='" ).append( remainder ).append( '\'' );
+        sb.append( ", contentType='" ).append( contentType ).append( '\'' );
+        sb.append( ", artifactType=" ).append( artifactType );
+        sb.append( '}' );
+        return sb.toString( );
+    }
+
     private static class Builder
         extends ContentItemBuilder<ArchivaArtifact, ArtifactOptBuilder, WithVersionObjectBuilder>
         implements ArtifactVersionBuilder, WithVersionObjectBuilder, ArtifactWithIdBuilder, ArtifactOptBuilder
index 5371e0335e3609cec5095c409001f4e7fd6993fc..b85f25a60940317fcac2699e39fbd2274e1edfcc 100644 (file)
@@ -87,6 +87,12 @@ public class ArchivaNamespace extends ArchivaContentItem implements Namespace
         return result;
     }
 
+    @Override
+    public String toString( )
+    {
+        return namespace;
+    }
+
     private static class Builder extends ContentItemBuilder<ArchivaNamespace, NamespaceOptBuilder, WithNamespaceBuilder>
         implements WithNamespaceBuilder, NamespaceOptBuilder
     {
index 4d902f33f99171d21a8d26a48666f0669e6c02b2..ac72f6217f28c51eda76bb1bd22fe717c5c3cda1 100644 (file)
@@ -97,6 +97,11 @@ public class ArchivaProject extends ArchivaContentItem implements Project
         return result;
     }
 
+    @Override
+    public String toString( )
+    {
+        return id + ", namespace="+namespace.toString();
+    }
 
     /*
      * Builder class
index 90b69217ff912e6b11ea5c6bde1d6f23c166fa9a..e10d3b1c52fefedc76928340af356a9ee855d0f3 100644 (file)
@@ -107,6 +107,12 @@ public class ArchivaVersion extends ArchivaContentItem implements Version
         return result;
     }
 
+    @Override
+    public String toString( )
+    {
+        return version+", project="+project.toString();
+    }
+
     private static final class Builder extends ContentItemBuilder<ArchivaVersion, VersionOptBuilder, WithProjectBuilder>
         implements WithProjectBuilder, WithVersionBuilder, VersionOptBuilder
     {