Resolves checkstyle errors for facade factory-kit spatial-partition state step-builder (#1077)
* Reduces checkstyle errors in facade * Reduces checkstyle errors in factory-kit * Reduces checkstyle errors in spatial-partition * Reduces checkstyle errors in state * Reduces checkstyle errors in step-builder
This commit is contained in:
committed by
Ilkka Seppälä
parent
2628cc0dfc
commit
c954a436ad
@ -24,23 +24,21 @@
|
||||
package com.iluwatar.facade;
|
||||
|
||||
/**
|
||||
*
|
||||
* The Facade design pattern is often used when a system is very complex or difficult to understand
|
||||
* because the system has a large number of interdependent classes or its source code is
|
||||
* unavailable. This pattern hides the complexities of the larger system and provides a simpler
|
||||
* interface to the client. It typically involves a single wrapper class which contains a set of
|
||||
* members required by client. These members access the system on behalf of the facade client and
|
||||
* hide the implementation details.
|
||||
* <p>
|
||||
* In this example the Facade is ({@link DwarvenGoldmineFacade}) and it provides a simpler interface
|
||||
* to the goldmine subsystem.
|
||||
*
|
||||
*
|
||||
* <p>In this example the Facade is ({@link DwarvenGoldmineFacade}) and it provides a simpler
|
||||
* interface to the goldmine subsystem.
|
||||
*/
|
||||
public class App {
|
||||
|
||||
/**
|
||||
* Program entry point
|
||||
*
|
||||
* Program entry point.
|
||||
*
|
||||
* @param args command line args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
|
@ -27,9 +27,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* DwarvenCartOperator is one of the goldmine subsystems.
|
||||
*
|
||||
*/
|
||||
public class DwarvenCartOperator extends DwarvenMineWorker {
|
||||
|
||||
|
@ -27,9 +27,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* DwarvenGoldDigger is one of the goldmine subsystems.
|
||||
*
|
||||
*/
|
||||
public class DwarvenGoldDigger extends DwarvenMineWorker {
|
||||
|
||||
|
@ -27,25 +27,24 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* DwarvenGoldmineFacade provides a single interface through which users can operate the subsystems.
|
||||
*
|
||||
* This makes the goldmine easier to operate and cuts the dependencies from the goldmine user to the
|
||||
* DwarvenGoldmineFacade provides a single interface through which users can operate the
|
||||
* subsystems.
|
||||
*
|
||||
* <p>This makes the goldmine easier to operate and cuts the dependencies from the goldmine user to
|
||||
* the subsystems.
|
||||
*/
|
||||
public class DwarvenGoldmineFacade {
|
||||
|
||||
private final List<DwarvenMineWorker> workers;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor.
|
||||
*/
|
||||
public DwarvenGoldmineFacade() {
|
||||
workers = List.of(
|
||||
new DwarvenGoldDigger(),
|
||||
new DwarvenCartOperator(),
|
||||
new DwarvenTunnelDigger());
|
||||
new DwarvenGoldDigger(),
|
||||
new DwarvenCartOperator(),
|
||||
new DwarvenTunnelDigger());
|
||||
}
|
||||
|
||||
public void startNewDay() {
|
||||
@ -60,8 +59,10 @@ public class DwarvenGoldmineFacade {
|
||||
makeActions(workers, DwarvenMineWorker.Action.GO_HOME, DwarvenMineWorker.Action.GO_TO_SLEEP);
|
||||
}
|
||||
|
||||
private static void makeActions(Collection<DwarvenMineWorker> workers,
|
||||
DwarvenMineWorker.Action... actions) {
|
||||
private static void makeActions(
|
||||
Collection<DwarvenMineWorker> workers,
|
||||
DwarvenMineWorker.Action... actions
|
||||
) {
|
||||
for (DwarvenMineWorker worker : workers) {
|
||||
worker.action(actions);
|
||||
}
|
||||
|
@ -27,9 +27,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* DwarvenMineWorker is one of the goldmine subsystems.
|
||||
*
|
||||
*/
|
||||
public abstract class DwarvenMineWorker {
|
||||
|
||||
@ -75,7 +73,7 @@ public abstract class DwarvenMineWorker {
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform actions
|
||||
* Perform actions.
|
||||
*/
|
||||
public void action(Action... actions) {
|
||||
for (Action action : actions) {
|
||||
|
@ -27,9 +27,7 @@ import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
* DwarvenTunnelDigger is one of the goldmine subsystems.
|
||||
*
|
||||
*/
|
||||
public class DwarvenTunnelDigger extends DwarvenMineWorker {
|
||||
|
||||
|
Reference in New Issue
Block a user