Skip to content

Commit 8d4faba

Browse files
committed
Updated docstrings, checkstyle, made ListAllInteractor use the SuperLocalPluginTracker instead
1 parent 9592c82 commit 8d4faba

File tree

4 files changed

+27
-23
lines changed

4 files changed

+27
-23
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
* Controller class for the ListAll use case.
1212
*
1313
* @author Kevin Chen
14-
*/
15-
public class ListController
16-
{
14+
* @author Azalea
15+
*/
16+
public class ListController {
1717
private final ListAllBoundary listAllBoundary;
1818

1919
/**
@@ -29,14 +29,15 @@ public ListController(ListAllBoundary listAllBoundary) {
2929
* Executes the ListAll use case.
3030
*
3131
* @param parameter The parameter for the ListAll use case.
32-
* @param log Logger
32+
* @param log Logger
3333
*/
3434
public void listAll(String parameter, Consumer<String> log) {
3535
var list = listAllBoundary.listAll(parameter);
3636

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

4142
log.accept(table);
4243
}

src/main/java/org/hydev/mcpm/client/database/ListAllBoundary.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package org.hydev.mcpm.client.database;
22

3-
43
import org.hydev.mcpm.client.models.PluginYml;
54

65
import java.util.List;
@@ -14,12 +13,16 @@
1413
public interface ListAllBoundary {
1514

1615
/**
17-
* listAllInteractor interacts with the LocalPluginTracker to get the list of plugins, according to a specified
16+
* listAllInteractor interacts with the LocalPluginTracker to get the list of
17+
* plugins, according to a specified
1818
* parameter
1919
*
20-
* @param parameter The parameter for the ListAll use case. 'All' denotes a request to list all manually
21-
* installed plugins, 'manual' denotes a request to list all manually installed plugins, and 'outdated' denotes
22-
* a request to list all manually installed plugins that are outdated.
20+
* @param parameter The parameter for the ListAll use case. 'All' denotes a
21+
* request to list all manually
22+
* installed plugins, 'manual' denotes a request to list all
23+
* manually installed plugins, and 'outdated' denotes
24+
* a request to list all manually installed plugins that are
25+
* outdated.
2326
*/
2427
List<PluginYml> listAll(String parameter);
2528
}

src/main/java/org/hydev/mcpm/client/database/ListAllInteractor.java

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,24 @@
1111
* @author Kevin (https://github.com/kchprog)
1212
* @since 2022-11-20
1313
*/
14-
public class ListAllInteractor implements ListAllBoundary
15-
{
16-
LocalPluginTracker localPluginTracker = new LocalPluginTracker();
14+
public class ListAllInteractor implements ListAllBoundary {
15+
SuperLocalPluginTracker localPluginTracker = new SuperLocalPluginTracker();
1716

1817
/**
19-
* listAllInteractor interacts with the LocalPluginTracker to get the list of plugins, according to a specified
18+
* listAllInteractor interacts with the LocalPluginTracker to get the list of
19+
* plugins, according to a specified
2020
* parameter
2121
*
22-
* @param parameter The parameter for the ListAll use case. 'All' denotes a request to list all manually
23-
* installed plugins, 'manual' denotes a request to list all manually installed plugins, and 'outdated' denotes
24-
* a request to list all manually installed plugins that are outdated.
22+
* @param parameter The parameter for the ListAll use case. 'All' denotes a
23+
* request to list all manually
24+
* installed plugins, 'manual' denotes a request to list all
25+
* manually installed plugins, and 'outdated' denotes
26+
* a request to list all manually installed plugins that are
27+
* outdated.
2528
*/
26-
public List<PluginYml> listAll(String parameter)
27-
{
29+
public List<PluginYml> listAll(String parameter) {
2830
var installed = localPluginTracker.listInstalled();
29-
switch (parameter)
30-
{
31+
switch (parameter) {
3132
case "all":
3233
return installed;
3334

src/main/java/org/hydev/mcpm/client/database/SuperLocalPluginTracker.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.hydev.mcpm.client.models.PluginYml.InvalidPluginMetaStructure;
1515
import org.hydev.mcpm.utils.PluginJarFile;
1616
import org.hydev.mcpm.client.models.PluginTrackerModel;
17-
import org.hydev.mcpm.client.database.SuperPluginTracker;
1817

1918
import java.io.*;
2019
import java.nio.file.Paths;

0 commit comments

Comments
 (0)