| 1 | package com.jsql.util; | |
| 2 | ||
| 3 | public class AnsiColorUtil { | |
| 4 | | |
| 5 | private static final String PREFIX = "\u001b["; | |
| 6 | | |
| 7 | private static final int DEFAULT = 0; | |
| 8 | | |
| 9 | private static final char SEPARATOR = ';'; | |
| 10 | | |
| 11 | private static final int FOREGROUND_RED = 31; | |
| 12 | private static final int FOREGROUND_GREEN = 32; | |
| 13 | | |
| 14 | private static final String SUFFIX = "m"; | |
| 15 | | |
| 16 | private static final String END_COLOR = AnsiColorUtil.PREFIX + AnsiColorUtil.SUFFIX; | |
| 17 | ||
| 18 | private static final String ERROR_COLOR = AnsiColorUtil.PREFIX + AnsiColorUtil.DEFAULT + AnsiColorUtil.SEPARATOR + AnsiColorUtil.FOREGROUND_RED + AnsiColorUtil.SUFFIX; | |
| 19 | private static final String INFO_COLOR = AnsiColorUtil.PREFIX + AnsiColorUtil.DEFAULT + AnsiColorUtil.SEPARATOR + AnsiColorUtil.FOREGROUND_GREEN + AnsiColorUtil.SUFFIX; | |
| 20 | ||
| 21 | private AnsiColorUtil() { | |
| 22 | // Utility class | |
| 23 | } | |
| 24 | ||
| 25 | public static String addGreenColor(String text) { | |
| 26 |
1
1. addGreenColor : replaced return value with "" for com/jsql/util/AnsiColorUtil::addGreenColor → NO_COVERAGE |
return AnsiColorUtil.INFO_COLOR + text + AnsiColorUtil.END_COLOR; |
| 27 | } | |
| 28 | | |
| 29 | public static String addRedColor(String text) { | |
| 30 |
1
1. addRedColor : replaced return value with "" for com/jsql/util/AnsiColorUtil::addRedColor → NO_COVERAGE |
return AnsiColorUtil.ERROR_COLOR + text + AnsiColorUtil.END_COLOR; |
| 31 | } | |
| 32 | } | |
Mutations | ||
| 26 |
1.1 |
|
| 30 |
1.1 |