Package dev.gradleplugins.runnerkit
Interface CommandLineToolLogContent
-
public interface CommandLineToolLogContentA representation of the log content from a command line tool execution. The log content can be manipulated according to the consumer's need.- Since:
- 0.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceCommandLineToolLogContent.LineDetails
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description CommandLineToolLogContentdrop(int n)Drops the first n lines.static CommandLineToolLogContentempty()Creates an empty log content.java.lang.StringgetAsString()Returns the log content as a string.java.util.List<java.lang.String>getLines()Returns this content separated into lines.static CommandLineToolLogContentof(java.lang.String content)Creates an log content of the specified string.CommandLineToolLogContentvisitEachLine(java.util.function.Consumer<CommandLineToolLogContent.LineDetails> visitor)Visit each lines.CommandLineToolLogContentwithAnsiControlCharactersInterpreted()Interprets a the ANSI control characters to produce plain text.CommandLineToolLogContentwithNormalizedEndOfLine()Returns this content formatted using a new line char to separate lines.
-
-
-
Method Detail
-
of
static CommandLineToolLogContent of(java.lang.String content)
Creates an log content of the specified string.- Parameters:
content- the raw content of the log content- Returns:
- an
CommandLineToolLogContentinstance representing the specified content, never null. - Since:
- 0.5
-
empty
static CommandLineToolLogContent empty()
Creates an empty log content.- Returns:
- an empty
CommandLineToolLogContentinstance, never null. - Since:
- 0.5
-
getAsString
java.lang.String getAsString()
Returns the log content as a string.- Returns:
- a
Stringrepresentation of the log content.
-
withNormalizedEndOfLine
CommandLineToolLogContent withNormalizedEndOfLine()
Returns this content formatted using a new line char to separate lines.- Returns:
- a new
CommandLineToolLogContentinstance using a new line char to separate lines, never null. - Since:
- 0.5
-
drop
CommandLineToolLogContent drop(int n)
Drops the first n lines.- Parameters:
n- the number of lines to drop from the log content- Returns:
- a new
CommandLineToolLogContentinstance without the first n lines, never null. - Since:
- 0.5
-
withAnsiControlCharactersInterpreted
CommandLineToolLogContent withAnsiControlCharactersInterpreted()
Interprets a the ANSI control characters to produce plain text.- Returns:
- a new
CommandLineToolLogContentinstance with all ANSI control characters interpreted, never null. - Since:
- 0.5
-
getLines
java.util.List<java.lang.String> getLines()
Returns this content separated into lines. The line does not include the line separator.- Returns:
- the lines of the content, never null.
- Since:
- 0.5
-
visitEachLine
CommandLineToolLogContent visitEachLine(java.util.function.Consumer<CommandLineToolLogContent.LineDetails> visitor)
Visit each lines.- Parameters:
visitor- log content line visitor, must not be null- Returns:
- a new
CommandLineToolLogContentinstance of the result following the visit, never null. - Since:
- 0.5
-
-