📍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
@@ -23,18 +23,17 @@
package com.iluwatar.dependency.injection;
import lombok.Setter;
/**
* AdvancedSorceress implements inversion of control. It depends on abstraction that can be injected
* through its setter.
*/
@Setter
public class AdvancedSorceress implements Wizard {
private Tobacco tobacco;
public void setTobacco(Tobacco tobacco) {
this.tobacco = tobacco;
}
@Override
public void smoke() {
tobacco.smoke(this);
@@ -23,18 +23,17 @@
package com.iluwatar.dependency.injection;
import lombok.RequiredArgsConstructor;
/**
* AdvancedWizard implements inversion of control. It depends on abstraction that can be injected
* through its constructor.
*/
@RequiredArgsConstructor
public class AdvancedWizard implements Wizard {
private final Tobacco tobacco;
public AdvancedWizard(Tobacco tobacco) {
this.tobacco = tobacco;
}
@Override
public void smoke() {
tobacco.smoke(this);
@@ -23,16 +23,14 @@
package com.iluwatar.dependency.injection;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
/**
* Tobacco abstraction.
*/
@Slf4j
public abstract class Tobacco {
private static final Logger LOGGER = LoggerFactory.getLogger(Tobacco.class);
public void smoke(Wizard wizard) {
LOGGER.info("{} smoking {}", wizard.getClass().getSimpleName(),
this.getClass().getSimpleName());