Skip to content

Commit aed04a1

Browse files
committed
Update ListController.java
1 parent 8808857 commit aed04a1

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/main/java/org/hydev/mcpm/client/commands/controllers/ListController.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.hydev.mcpm.client.commands.controllers;
22

33
import org.hydev.mcpm.client.list.ListAllBoundary;
4+
import org.hydev.mcpm.client.updater.CheckForUpdatesBoundary;
45

56
import java.util.List;
67
import java.util.function.Consumer;
@@ -11,33 +12,34 @@
1112
* Controller class for the ListAll use case.
1213
*
1314
* @author Kevin Chen
14-
*/
15-
public class ListController
16-
{
15+
*/
16+
public class ListController {
1717
private final ListAllBoundary listAllBoundary;
18+
private final CheckForUpdatesBoundary checkForUpdatesBoundary;
1819

1920
/**
2021
* Constructor for ListAllController.
2122
*
2223
* @param listAllBoundary The boundary class for ListAllController.
2324
*/
24-
public ListController(ListAllBoundary listAllBoundary) {
25+
public ListController(ListAllBoundary listAllBoundary, CheckForUpdatesBoundary checkForUpdatesBoundary) {
2526
this.listAllBoundary = listAllBoundary;
27+
this.checkForUpdatesBoundary = checkForUpdatesBoundary;
2628
}
2729

2830
/**
2931
* Executes the ListAll use case.
3032
*
3133
* @param parameter The parameter for the ListAll use case.
32-
* @param log Logger
34+
* @param log Logger
3335
*/
3436
public void listAll(String parameter, Consumer<String> log) {
35-
var list = listAllBoundary.listAll(parameter);
37+
var list = listAllBoundary.listAll(parameter, checkForUpdatesBoundary);
3638

3739
// Tabulate result
38-
var table = tabulate(list.stream().map(p ->
39-
List.of("&a" + p.name(), "&e" + p.getFirstAuthor(), p.version())).toList(),
40-
List.of(":Name", "Author", "Version:"));
40+
var table = tabulate(
41+
list.stream().map(p -> List.of("&a" + p.name(), "&e" + p.getFirstAuthor(), p.version())).toList(),
42+
List.of(":Name", "Author", "Version:"));
4143

4244
log.accept(table);
4345
}

0 commit comments

Comments
 (0)