|
12 | 12 | import java.util.regex.Pattern;
|
13 | 13 |
|
14 | 14 | import io.sloeber.core.api.Defaults;
|
| 15 | +import io.sloeber.core.api.LibraryDescriptor; |
15 | 16 | import io.sloeber.core.tools.Version;
|
16 | 17 |
|
| 18 | +/** |
| 19 | + * This class represents a json file that references libraries |
| 20 | + * |
| 21 | + * @author jan |
| 22 | + * |
| 23 | + */ |
17 | 24 | public class LibraryIndex {
|
18 | 25 | private String jsonFileName;
|
19 | 26 | private List<Library> libraries;
|
@@ -101,11 +108,11 @@ public Map<String, Library> getLatestLibraries() {
|
101 | 108 | *
|
102 | 109 | * @return
|
103 | 110 | */
|
104 |
| - public Map<String, Library> getLatestInstallableLibraries() { |
105 |
| - Map<String, Library> ret = new HashMap<>(); |
| 111 | + public Map<String, LibraryDescriptor> getLatestInstallableLibraries() { |
| 112 | + Map<String, LibraryDescriptor> ret = new HashMap<>(); |
106 | 113 | for (Entry<String, Library> curLibrary : this.latestLibs.entrySet()) {
|
107 | 114 | if (!curLibrary.getValue().isAVersionInstalled()) {
|
108 |
| - ret.put(curLibrary.getKey(), curLibrary.getValue()); |
| 115 | + ret.put(curLibrary.getKey(),new LibraryDescriptor( curLibrary.getValue())); |
109 | 116 | }
|
110 | 117 | }
|
111 | 118 | return ret;
|
@@ -147,15 +154,15 @@ public String getName() {
|
147 | 154 | *
|
148 | 155 | * @return
|
149 | 156 | */
|
150 |
| - public Map<String, Library> getLatestInstallableLibraries(Set<String> libNames) { |
151 |
| - Map<String, Library> ret = new HashMap<>(); |
| 157 | + public Map<String, LibraryDescriptor> getLatestInstallableLibraries(Set<String> libNames) { |
| 158 | + Map<String, LibraryDescriptor> ret = new HashMap<>(); |
152 | 159 | if (libNames.isEmpty()) {
|
153 | 160 | return ret;
|
154 | 161 | }
|
155 | 162 | for (Entry<String, Library> curLibrary : this.latestLibs.entrySet()) {
|
156 | 163 | if (libNames.contains(curLibrary.getKey())) {
|
157 | 164 | if (!curLibrary.getValue().isAVersionInstalled()) {
|
158 |
| - ret.put(curLibrary.getKey(), curLibrary.getValue()); |
| 165 | + ret.put(curLibrary.getKey(), new LibraryDescriptor(curLibrary.getValue())); |
159 | 166 | }
|
160 | 167 | }
|
161 | 168 | }
|
|
0 commit comments