You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
836 B
29 lines
836 B
package com.example.moviecli.view;
|
|
|
|
import java.util.Scanner;
|
|
|
|
public class ConsoleView {
|
|
private static final String ANSI_RESET = "\u001B[0m";
|
|
private static final String ANSI_GREEN = "\u001B[32m";
|
|
private static final String ANSI_RED = "\u001B[31m";
|
|
private static final String ANSI_BLUE = "\u001B[34m";
|
|
|
|
private final Scanner scanner = new Scanner(System.in);
|
|
|
|
public String readLine() {
|
|
System.out.print("> ");
|
|
return scanner.nextLine();
|
|
}
|
|
|
|
public void printSuccess(String msg) {
|
|
System.out.println(ANSI_GREEN + msg + ANSI_RESET);
|
|
}
|
|
|
|
public void printError(String msg) {
|
|
System.out.println(ANSI_RED + msg + ANSI_RESET);
|
|
}
|
|
|
|
public void printInfo(String msg) {
|
|
System.out.println(ANSI_BLUE + msg + ANSI_RESET);
|
|
}
|
|
}
|