mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-09-05 10:19:14 +00:00
refactoring: Adding lombok to MVC pattern (#2188)
* Refactor: Added lombok to data-transfer-object pattern * Refactor: Added lombok to data-transfer-object pattern * Fix: Reverting all-contributors changes * Fix: Fixing checkstyle for DTO * Fix: Fixing checkstyle for Product.java * Feature: Added lombok to MVC * Fix: Fix imports
This commit is contained in:
@@ -24,9 +24,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.iluwatar.model.view.controller;
|
package com.iluwatar.model.view.controller;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fatigue enumeration.
|
* Fatigue enumeration.
|
||||||
*/
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
public enum Fatigue {
|
public enum Fatigue {
|
||||||
ALERT("alert"),
|
ALERT("alert"),
|
||||||
TIRED("tired"),
|
TIRED("tired"),
|
||||||
@@ -34,9 +37,6 @@ public enum Fatigue {
|
|||||||
|
|
||||||
private final String title;
|
private final String title;
|
||||||
|
|
||||||
Fatigue(String title) {
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|||||||
+11
-32
@@ -24,47 +24,26 @@
|
|||||||
*/
|
*/
|
||||||
package com.iluwatar.model.view.controller;
|
package com.iluwatar.model.view.controller;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GiantModel contains the giant data.
|
* GiantModel contains the giant data.
|
||||||
*/
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
public class GiantModel {
|
public class GiantModel {
|
||||||
|
|
||||||
private Health health;
|
private Health health;
|
||||||
private Fatigue fatigue;
|
private Fatigue fatigue;
|
||||||
private Nourishment nourishment;
|
private Nourishment nourishment;
|
||||||
|
|
||||||
/**
|
|
||||||
* Instantiates a new GiantModel.
|
|
||||||
*/
|
|
||||||
public GiantModel(Health health, Fatigue fatigue, Nourishment nourishment) {
|
|
||||||
this.health = health;
|
|
||||||
this.fatigue = fatigue;
|
|
||||||
this.nourishment = nourishment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Health getHealth() {
|
|
||||||
return health;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setHealth(Health health) {
|
|
||||||
this.health = health;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Fatigue getFatigue() {
|
|
||||||
return fatigue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFatigue(Fatigue fatigue) {
|
|
||||||
this.fatigue = fatigue;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Nourishment getNourishment() {
|
|
||||||
return nourishment;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNourishment(Nourishment nourishment) {
|
|
||||||
this.nourishment = nourishment;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|||||||
@@ -24,9 +24,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.iluwatar.model.view.controller;
|
package com.iluwatar.model.view.controller;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Health enumeration.
|
* Health enumeration.
|
||||||
*/
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
public enum Health {
|
public enum Health {
|
||||||
HEALTHY("healthy"),
|
HEALTHY("healthy"),
|
||||||
WOUNDED("wounded"),
|
WOUNDED("wounded"),
|
||||||
@@ -34,9 +37,6 @@ public enum Health {
|
|||||||
|
|
||||||
private final String title;
|
private final String title;
|
||||||
|
|
||||||
Health(String title) {
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|||||||
+3
-3
@@ -24,9 +24,12 @@
|
|||||||
*/
|
*/
|
||||||
package com.iluwatar.model.view.controller;
|
package com.iluwatar.model.view.controller;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Nourishment enumeration.
|
* Nourishment enumeration.
|
||||||
*/
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
public enum Nourishment {
|
public enum Nourishment {
|
||||||
SATURATED("saturated"),
|
SATURATED("saturated"),
|
||||||
HUNGRY("hungry"),
|
HUNGRY("hungry"),
|
||||||
@@ -34,9 +37,6 @@ public enum Nourishment {
|
|||||||
|
|
||||||
private final String title;
|
private final String title;
|
||||||
|
|
||||||
Nourishment(String title) {
|
|
||||||
this.title = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
|||||||
Reference in New Issue
Block a user