Package tk.thesuperlab.photonlib.console
Class ConsoleUtils
java.lang.Object
tk.thesuperlab.photonlib.console.ConsoleUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic com.diogonunes.jcolor.Attribute[]
static com.diogonunes.jcolor.Attribute[]
static com.diogonunes.jcolor.Attribute[]
static com.diogonunes.jcolor.Attribute[]
static com.diogonunes.jcolor.Attribute[]
static com.diogonunes.jcolor.Attribute[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Clears consolestatic void
printError
(String errorMessage) Print error to standard outputstatic void
printError
(String message, ErrorType errorType) Prints error to standard output with pre-made type and custom messagestatic void
printError
(ErrorType errorType) Prints error to standard output with pre-made typestatic void
printMessage
(String message) Sysout equivalentstatic int
printOptions
(String optionsPrompt, String... options) Prompt user for options.static void
printTitle
(String title) Print section titlestatic void
printUtilityTitle
(String utilityName, String utilityVersion) Print utility titlestatic String
Prompt user
-
Field Details
-
errorFormat
public static com.diogonunes.jcolor.Attribute[] errorFormat -
promptFormat
public static com.diogonunes.jcolor.Attribute[] promptFormat -
titleFormat
public static com.diogonunes.jcolor.Attribute[] titleFormat -
optionsTitleFormat
public static com.diogonunes.jcolor.Attribute[] optionsTitleFormat -
optionFormat
public static com.diogonunes.jcolor.Attribute[] optionFormat -
successFormat
public static com.diogonunes.jcolor.Attribute[] successFormat
-
-
Constructor Details
-
ConsoleUtils
public ConsoleUtils()
-
-
Method Details
-
printOptions
Prompt user for options.- Parameters:
optionsPrompt
- User promptoptions
- Option list- Returns:
- selected option
-
printUtilityTitle
Print utility title- Parameters:
utilityName
- Name of utilityutilityVersion
- Utility version
-
printMessage
Sysout equivalent- Parameters:
message
-
-
printTitle
Print section title- Parameters:
title
- Title string
-
prompt
Prompt user- Parameters:
prompt
- Prompt string- Returns:
- User input
-
clearConsole
public static void clearConsole()Clears console -
printError
Print error to standard output- Parameters:
errorMessage
- Error string
-
printError
Prints error to standard output with pre-made type- Parameters:
errorType
- Error type
-
printError
Prints error to standard output with pre-made type and custom message- Parameters:
message
- Error stringerrorType
- Error type
-