1
2
3
4
5
6
7
8
9
10
11 package com.jsql.view.terminal.interaction;
12
13 import com.jsql.model.bean.database.Database;
14 import com.jsql.util.AnsiColorUtil;
15 import com.jsql.view.interaction.InteractionCommand;
16 import org.apache.logging.log4j.LogManager;
17 import org.apache.logging.log4j.Logger;
18
19 import java.util.List;
20
21
22
23
24 public class AddDatabases implements InteractionCommand {
25
26 private static final Logger LOGGER = LogManager.getRootLogger();
27
28
29
30
31 private final List<Database> databases;
32
33
34
35
36 @SuppressWarnings("unchecked")
37 public AddDatabases(Object[] interactionParams) {
38 this.databases = (List<Database>) interactionParams[0];
39 }
40
41 @Override
42 public void execute() {
43
44 LOGGER.info(() -> AnsiColorUtil.addGreenColor(this.getClass().getSimpleName()));
45
46 for (Database database: this.databases) {
47 LOGGER.debug(database);
48 }
49 }
50 }