package org.ligi.gradecoba;

import java.util.ArrayList;
import java.util.List;

public class ArtifactProvider {
	private List<Artifact> artifacts;
	
	public List<Artifact> getArtifacts() {
		if (artifacts==null) {
            artifacts = new ArrayList<Artifact>();
			artifacts.add(new GoogleArtifact("play-services","4.0.30","google",false));
			artifacts.add(new AndroidArtifact("gridlayout-v7","18.0.0","android-support",false));
			artifacts.add(new AndroidArtifact("support-v13","19.0.0","android-support",false));
			artifacts.add(new AndroidArtifact("mediarouter-v7","19.0.0","android-support",false));
			artifacts.add(new AndroidArtifact("appcompat-v7","19.0.0","android-support",false));
			artifacts.add(new AndroidArtifact("support-v4","19.0.0","android-support",false));
		}
		
		return artifacts; 
	}


    public List<Artifact> searchArtifacts(String query) {
        List<Artifact> res = new ArrayList<Artifact>();

        if (query.startsWith("gms")) {
            query="play";
        }

        for (Artifact artifact:getArtifacts()) {
            if (artifact.getName().contains(query)) {
                res.add(artifact);
            }
        }
        return res;
    }
}


@@ -318,12 +318,12 @@
 ,%224.
-0.30
+3.23
 %22,%22g
@@ -397,11 +397,11 @@
 %22,%221
-8.0
+9.1
 .0%22,
@@ -478,25 +478,25 @@
 rt-v13%22,%2219.
-0
+1
 .0%22,%22android
@@ -564,33 +564,33 @@
 arouter-v7%22,%2219.
-0
+1
 .0%22,%22android-sup
@@ -656,25 +656,25 @@
 pat-v7%22,%2219.
-0
+1
 .0%22,%22android
@@ -746,17 +746,17 @@
 v4%22,%2219.
-0
+1
 .0%22,%22and

update to latest versions