mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-17 04:59:21 +00:00
📍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:
@@ -23,16 +23,14 @@
|
||||
|
||||
package com.iluwatar.proxy;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* The object to be proxied.
|
||||
*/
|
||||
@Slf4j
|
||||
public class IvoryTower implements WizardTower {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(IvoryTower.class);
|
||||
|
||||
public void enter(Wizard wizard) {
|
||||
LOGGER.info("{} enters the tower.", wizard);
|
||||
}
|
||||
|
||||
@@ -23,17 +23,16 @@
|
||||
|
||||
package com.iluwatar.proxy;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
* Wizard.
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
public class Wizard {
|
||||
|
||||
private final String name;
|
||||
|
||||
public Wizard(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
|
||||
@@ -23,16 +23,14 @@
|
||||
|
||||
package com.iluwatar.proxy;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* The proxy controlling access to the {@link IvoryTower}.
|
||||
*/
|
||||
@Slf4j
|
||||
public class WizardTowerProxy implements WizardTower {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(WizardTowerProxy.class);
|
||||
|
||||
private static final int NUM_WIZARDS_ALLOWED = 3;
|
||||
|
||||
private int numWizards;
|
||||
|
||||
Reference in New Issue
Block a user