📍Use lombok, reformat, and optimize the code (#1560)

* Use lombok, reformat, and optimize the code

* Fix merge conflicts and some sonar issues

Co-authored-by: va1m <va1m@email.com>
This commit is contained in:
va1m
2021-03-13 13:19:21 +01:00
committed by GitHub
parent 0e26a6adb5
commit 5cf2fe009b
681 changed files with 2472 additions and 4966 deletions

View File

@ -68,8 +68,8 @@ public enum RequestType {
Then the request handler hierarchy
```java
@Slf4j
public abstract class RequestHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(RequestHandler.class);
private final RequestHandler next;
public RequestHandler(RequestHandler next) {

View File

@ -47,6 +47,5 @@ public class App {
king.makeRequest(new Request(RequestType.DEFEND_CASTLE, "defend castle"));
king.makeRequest(new Request(RequestType.TORTURE_PRISONER, "torture prisoner"));
king.makeRequest(new Request(RequestType.COLLECT_TAX, "collect tax"));
}
}

View File

@ -23,22 +23,18 @@
package com.iluwatar.chain;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* RequestHandler.
*/
@Slf4j
@AllArgsConstructor
public abstract class RequestHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(RequestHandler.class);
private final RequestHandler next;
public RequestHandler(RequestHandler next) {
this.next = next;
}
/**
* Request handler.
*/

View File

@ -28,6 +28,8 @@ package com.iluwatar.chain;
*/
public enum RequestType {
DEFEND_CASTLE, TORTURE_PRISONER, COLLECT_TAX
DEFEND_CASTLE,
TORTURE_PRISONER,
COLLECT_TAX
}

View File

@ -33,7 +33,7 @@ import org.junit.jupiter.api.Test;
*
* @author Jeroen Meulemeester
*/
public class OrcKingTest {
class OrcKingTest {
/**
* All possible requests
@ -45,7 +45,7 @@ public class OrcKingTest {
);
@Test
public void testMakeRequest() {
void testMakeRequest() {
final var king = new OrcKing();
REQUESTS.forEach(request -> {