maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ogusa...@apache.org
Subject svn commit: r712333 - /maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ArtifactMetadataList.java
Date Sat, 08 Nov 2008 01:12:35 GMT
Author: ogusakov
Date: Fri Nov  7 17:12:35 2008
New Revision: 712333

URL: http://svn.apache.org/viewvc?rev=712333&view=rev
Log:
addes a helper class

Modified:
    maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ArtifactMetadataList.java

Modified: maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ArtifactMetadataList.java
URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ArtifactMetadataList.java?rev=712333&r1=712332&r2=712333&view=diff
==============================================================================
--- maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ArtifactMetadataList.java
(original)
+++ maven/mercury/trunk/mercury-artifact/src/main/java/org/apache/maven/mercury/artifact/ArtifactMetadataList.java
Fri Nov  7 17:12:35 2008
@@ -18,7 +18,18 @@
   public ArtifactMetadataList( ArtifactBasicMetadata... md )
   {
     for( ArtifactBasicMetadata m : md )
-      _artifacts.add( m );
+      add( m );
+  }
+
+  public ArtifactMetadataList( Collection<ArtifactBasicMetadata> md )
+  {
+    add( md );
+  }
+
+  public ArtifactMetadataList( String... mds )
+  {
+    for( String m : mds )
+      add( new ArtifactBasicMetadata(m) );
   }
   
   public void add( ArtifactBasicMetadata md )
@@ -31,8 +42,34 @@
     _artifacts.addAll( md );
   }
   
-  List<ArtifactBasicMetadata> getMetadataList()
+  public void addGav( String md )
+  {
+    _artifacts.add( new ArtifactBasicMetadata(md) );
+  }
+  
+  public void addByGav( Collection<String> mds )
+  {
+    for( String m : mds )
+      _artifacts.add( new ArtifactBasicMetadata(m) );
+  }
+  
+  public List<ArtifactBasicMetadata> getMetadataList()
   {
     return _artifacts;
   }
+  
+  public int size()
+  {
+    return _artifacts.size();
+  }
+  
+  public boolean isEmpty()
+  {
+    return _artifacts.isEmpty();
+  }
+  
+  public void clear()
+  {
+    _artifacts.clear();
+  }
 }



Mime
View raw message