Created
September 21, 2014 21:16
-
-
Save Unh0lyTigg/8a74b523e29e7b8ffaa5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.utlauncher; | |
import java.util.List; | |
import org.utlauncher.data.Package; | |
import com.google.common.collect.Lists; | |
public enum PackageManager { | |
INSTANCE; | |
private List<Package> packs = Lists.newArrayList(); | |
public static void initialize() { | |
} | |
public Package getPackageByName(String packname) { | |
return packs.stream().filter(p-> {return p.getPackageName().equals(packname);}).findFirst().orElse(null); | |
} | |
public Package getPackage(String packname) { // works the exact same way as getPackageByName(String) .... | |
for (Package p : packs) | |
if (p.getPackageName().equals(packname)) | |
return p; | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment