java.lang.Object
io.github.darvil.lanat.CLInput
A class to gather the input from the command line.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull CLInputConstructs a newCLInputfrom the given arguments string.static @NotNull CLInputConstructs a newCLInputfrom the given arguments array.static @NotNull CLInputConstructs a newCLInputfrom the given file.static @NotNull CLInputConstructs a newCLInputfrom the standard input.static @NotNull CLInputGets the arguments passed to the program from the system property"sun.java.command".booleanisEmpty()Returnstrueif no arguments were passed to the program.
-
Field Details
-
args
The string of arguments passed to the program.
-
-
Method Details
-
from
Constructs a newCLInputfrom the given arguments array.- Parameters:
args- The array of arguments.- Returns:
- A new
CLInputfrom the given arguments array.
-
from
Constructs a newCLInputfrom the given arguments string.- Parameters:
args- The arguments string.- Returns:
- A new
CLInputfrom the given arguments string.
-
fromSystemProperty
Gets the arguments passed to the program from the system property"sun.java.command".- Returns:
- A new
CLInputfrom the system property"sun.java.command".
-
fromFile
Constructs a newCLInputfrom the given file. The input will be the contents of the file. If the file does not exist, the input will be an empty string.- Parameters:
file- The file to read the input from.- Returns:
- A new
CLInputfrom the given file.
-
fromStandardInput
Constructs a newCLInputfrom the standard input. The input will be the first line read.- Returns:
- A new
CLInputfrom the standard input.
-
isEmpty
public boolean isEmpty()Returnstrueif no arguments were passed to the program.
-