📍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

@ -23,8 +23,7 @@
package com.iluwatar.bridge;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
/**
* Composition over inheritance. The Bridge pattern can also be thought of as two layers of
@ -39,10 +38,9 @@ import org.slf4j.LoggerFactory;
* enchantments. We can easily combine any weapon with any enchantment using composition instead of
* creating deep class hierarchy.
*/
@Slf4j
public class App {
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
/**
* Program entry point.
*

View File

@ -23,16 +23,14 @@
package com.iluwatar.bridge;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
/**
* FlyingEnchantment.
*/
@Slf4j
public class FlyingEnchantment implements Enchantment {
private static final Logger LOGGER = LoggerFactory.getLogger(FlyingEnchantment.class);
@Override
public void onActivate() {
LOGGER.info("The item begins to glow faintly.");

View File

@ -23,22 +23,18 @@
package com.iluwatar.bridge;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* Hammer.
*/
@Slf4j
@AllArgsConstructor
public class Hammer implements Weapon {
private static final Logger LOGGER = LoggerFactory.getLogger(Hammer.class);
private final Enchantment enchantment;
public Hammer(Enchantment enchantment) {
this.enchantment = enchantment;
}
@Override
public void wield() {
LOGGER.info("The hammer is wielded.");

View File

@ -23,16 +23,14 @@
package com.iluwatar.bridge;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.extern.slf4j.Slf4j;
/**
* SoulEatingEnchantment.
*/
@Slf4j
public class SoulEatingEnchantment implements Enchantment {
private static final Logger LOGGER = LoggerFactory.getLogger(SoulEatingEnchantment.class);
@Override
public void onActivate() {
LOGGER.info("The item spreads bloodlust.");

View File

@ -23,22 +23,18 @@
package com.iluwatar.bridge;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* Sword.
*/
@Slf4j
@AllArgsConstructor
public class Sword implements Weapon {
private static final Logger LOGGER = LoggerFactory.getLogger(Sword.class);
private final Enchantment enchantment;
public Sword(Enchantment enchantment) {
this.enchantment = enchantment;
}
@Override
public void wield() {
LOGGER.info("The sword is wielded.");