📍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:
@ -24,8 +24,7 @@
|
||||
package com.iluwatar.property;
|
||||
|
||||
import com.iluwatar.property.Character.Type;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* The Property pattern is also known as Prototype inheritance.
|
||||
@ -38,10 +37,9 @@ import org.slf4j.LoggerFactory;
|
||||
*
|
||||
* <p>In this example we demonstrate {@link Character} instantiation using the Property pattern.
|
||||
*/
|
||||
@Slf4j
|
||||
public class App {
|
||||
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(App.class);
|
||||
|
||||
/**
|
||||
* Program entry point.
|
||||
*
|
||||
|
@ -40,7 +40,7 @@ import org.junit.jupiter.api.Test;
|
||||
public class CharacterTest {
|
||||
|
||||
@Test
|
||||
public void testPrototypeStats() throws Exception {
|
||||
void testPrototypeStats() throws Exception {
|
||||
final var prototype = new Character();
|
||||
|
||||
for (final var stat : Stats.values()) {
|
||||
@ -60,7 +60,7 @@ public class CharacterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCharacterStats() {
|
||||
void testCharacterStats() {
|
||||
final var prototype = new Character();
|
||||
Arrays.stream(Stats.values()).forEach(stat -> prototype.set(stat, stat.ordinal()));
|
||||
|
||||
@ -73,7 +73,7 @@ public class CharacterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testToString() {
|
||||
void testToString() {
|
||||
final var prototype = new Character();
|
||||
prototype.set(Stats.ARMOR, 1);
|
||||
prototype.set(Stats.AGILITY, 2);
|
||||
@ -91,7 +91,7 @@ public class CharacterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testName() {
|
||||
void testName() {
|
||||
final var prototype = new Character();
|
||||
prototype.set(Stats.ARMOR, 1);
|
||||
prototype.set(Stats.INTELLECT, 2);
|
||||
@ -107,7 +107,7 @@ public class CharacterTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testType() {
|
||||
void testType() {
|
||||
final var prototype = new Character();
|
||||
prototype.set(Stats.ARMOR, 1);
|
||||
prototype.set(Stats.INTELLECT, 2);
|
||||
|
Reference in New Issue
Block a user