Resolves checkstyle errors for remaining p (#1091)
* Reduces checkstyle errors in page-object * Reduces checkstyle errors in partial-response * Reduces checkstyle errors in pipeline * Reduces checkstyle errors in poison-pill * Reduces checkstyle errors in priority-queue * Reduces checkstyle errors in private-class-data * Reduces checkstyle errors in property * Reduces checkstyle errors in prototype * Reduces checkstyle errors in proxy
This commit is contained in:
committed by
Ilkka Seppälä
parent
1fdc650545
commit
271d7ae9bd
@ -24,21 +24,20 @@
|
||||
package com.iluwatar.pipeline;
|
||||
|
||||
/**
|
||||
* The Pipeline pattern uses ordered stages to process a sequence of input values.
|
||||
* Each implemented task is represented by a stage of the pipeline. You can think of
|
||||
* pipelines as similar to assembly lines in a factory, where each item in the assembly
|
||||
* line is constructed in stages. The partially assembled item is passed from one assembly
|
||||
* stage to another. The outputs of the assembly line occur in the same order as that of the
|
||||
* inputs.
|
||||
* The Pipeline pattern uses ordered stages to process a sequence of input values. Each implemented
|
||||
* task is represented by a stage of the pipeline. You can think of pipelines as similar to assembly
|
||||
* lines in a factory, where each item in the assembly line is constructed in stages. The partially
|
||||
* assembled item is passed from one assembly stage to another. The outputs of the assembly line
|
||||
* occur in the same order as that of the inputs.
|
||||
*
|
||||
* Classes used in this example are suffixed with "Handlers", and synonymously refers to the
|
||||
* <p>Classes used in this example are suffixed with "Handlers", and synonymously refers to the
|
||||
* "stage".
|
||||
*/
|
||||
public class App {
|
||||
/**
|
||||
* Specify the initial input type for the first stage handler and the expected output type
|
||||
* of the last stage handler as type parameters for Pipeline. Use the fluent builder by
|
||||
* calling addHandler to add more stage handlers on the pipeline.
|
||||
* Specify the initial input type for the first stage handler and the expected output type of the
|
||||
* last stage handler as type parameters for Pipeline. Use the fluent builder by calling
|
||||
* addHandler to add more stage handlers on the pipeline.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
/*
|
||||
|
@ -23,11 +23,10 @@
|
||||
|
||||
package com.iluwatar.pipeline;
|
||||
|
||||
import java.util.Arrays;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* Stage handler that converts an input String to its char[] array counterpart.
|
||||
*/
|
||||
@ -38,8 +37,10 @@ class ConvertToCharArrayHandler implements Handler<String, char[]> {
|
||||
@Override
|
||||
public char[] process(String input) {
|
||||
char[] characters = input.toCharArray();
|
||||
LOGGER.info(String.format("Current handler: %s, input is %s of type %s, output is %s, of type %s",
|
||||
ConvertToCharArrayHandler.class, input, String.class, Arrays.toString(characters), Character[].class));
|
||||
LOGGER
|
||||
.info(String.format("Current handler: %s, input is %s of type %s, output is %s, of type %s",
|
||||
ConvertToCharArrayHandler.class, input, String.class, Arrays
|
||||
.toString(characters), Character[].class));
|
||||
|
||||
return characters;
|
||||
}
|
||||
|
@ -24,7 +24,9 @@
|
||||
package com.iluwatar.pipeline;
|
||||
|
||||
/**
|
||||
* Forms a contract to all stage handlers to accept a certain type of input and return a processed output.
|
||||
* Forms a contract to all stage handlers to accept a certain type of input and return a processed
|
||||
* output.
|
||||
*
|
||||
* @param <I> the input type of the handler
|
||||
* @param <O> the processed output type of the handler
|
||||
*/
|
||||
|
@ -24,8 +24,9 @@
|
||||
package com.iluwatar.pipeline;
|
||||
|
||||
/**
|
||||
* Main Pipeline class that initially sets the current handler. Processed output
|
||||
* of the initial handler is then passed as the input to the next stage handlers.
|
||||
* Main Pipeline class that initially sets the current handler. Processed output of the initial
|
||||
* handler is then passed as the input to the next stage handlers.
|
||||
*
|
||||
* @param <I> the type of the input for the first stage handler
|
||||
* @param <O> the final stage handler's output type
|
||||
*/
|
||||
|
@ -27,7 +27,8 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Stage handler that returns a new instance of String without the alphabet characters of the input string.
|
||||
* Stage handler that returns a new instance of String without the alphabet characters of the input
|
||||
* string.
|
||||
*/
|
||||
class RemoveAlphabetsHandler implements Handler<String, String> {
|
||||
|
||||
@ -47,8 +48,13 @@ class RemoveAlphabetsHandler implements Handler<String, String> {
|
||||
}
|
||||
|
||||
String inputWithoutAlphabetsStr = inputWithoutAlphabets.toString();
|
||||
LOGGER.info(String.format("Current handler: %s, input is %s of type %s, output is %s, of type %s",
|
||||
RemoveAlphabetsHandler.class, input, String.class, inputWithoutAlphabetsStr, String.class));
|
||||
LOGGER.info(
|
||||
String.format(
|
||||
"Current handler: %s, input is %s of type %s, output is %s, of type %s",
|
||||
RemoveAlphabetsHandler.class, input,
|
||||
String.class, inputWithoutAlphabetsStr, String.class
|
||||
)
|
||||
);
|
||||
|
||||
return inputWithoutAlphabetsStr;
|
||||
}
|
||||
|
@ -27,7 +27,8 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Stage handler that returns a new instance of String without the digit characters of the input string.
|
||||
* Stage handler that returns a new instance of String without the digit characters of the input
|
||||
* string.
|
||||
*/
|
||||
class RemoveDigitsHandler implements Handler<String, String> {
|
||||
|
||||
@ -47,8 +48,9 @@ class RemoveDigitsHandler implements Handler<String, String> {
|
||||
}
|
||||
|
||||
String inputWithoutDigitsStr = inputWithoutDigits.toString();
|
||||
LOGGER.info(String.format("Current handler: %s, input is %s of type %s, output is %s, of type %s",
|
||||
RemoveDigitsHandler.class, input, String.class, inputWithoutDigitsStr, String.class));
|
||||
LOGGER
|
||||
.info(String.format("Current handler: %s, input is %s of type %s, output is %s, of type %s",
|
||||
RemoveDigitsHandler.class, input, String.class, inputWithoutDigitsStr, String.class));
|
||||
|
||||
return inputWithoutDigitsStr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user