📍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:
@ -54,10 +54,9 @@ public abstract class Task {
|
||||
public abstract void execute();
|
||||
}
|
||||
|
||||
@Slf4j
|
||||
public final class SimpleTask extends Task {
|
||||
|
||||
private static final Logger LOGGER = getLogger(SimpleTask.class);
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
LOGGER.info("Perform some important activity and after call the callback method.");
|
||||
|
@ -23,19 +23,16 @@
|
||||
|
||||
package com.iluwatar.callback;
|
||||
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Callback pattern is more native for functional languages where functions are treated as
|
||||
* first-class citizens. Prior to Java 8 callbacks can be simulated using simple (alike command)
|
||||
* interfaces.
|
||||
*/
|
||||
@Slf4j
|
||||
public final class App {
|
||||
|
||||
private static final Logger LOGGER = getLogger(App.class);
|
||||
|
||||
private App() {
|
||||
}
|
||||
|
||||
|
@ -23,20 +23,16 @@
|
||||
|
||||
package com.iluwatar.callback;
|
||||
|
||||
import static org.slf4j.LoggerFactory.getLogger;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Implementation of task that need to be executed.
|
||||
*/
|
||||
@Slf4j
|
||||
public final class SimpleTask extends Task {
|
||||
|
||||
private static final Logger LOGGER = getLogger(SimpleTask.class);
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
LOGGER.info("Perform some important activity and after call the"
|
||||
+ " callback method.");
|
||||
LOGGER.info("Perform some important activity and after call the callback method.");
|
||||
}
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class CallbackTest {
|
||||
private Integer callingCount = 0;
|
||||
|
||||
@Test
|
||||
public void test() {
|
||||
void test() {
|
||||
Callback callback = () -> callingCount++;
|
||||
|
||||
var task = new SimpleTask();
|
||||
|
Reference in New Issue
Block a user