mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 10:58:42 +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;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* Fatigue enumeration.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public enum Fatigue {
|
||||
ALERT("alert"),
|
||||
TIRED("tired"),
|
||||
@@ -34,9 +37,6 @@ public enum Fatigue {
|
||||
|
||||
private final String title;
|
||||
|
||||
Fatigue(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
+11
-32
@@ -24,47 +24,26 @@
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class GiantModel {
|
||||
|
||||
private Health health;
|
||||
private Fatigue fatigue;
|
||||
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
|
||||
public String toString() {
|
||||
|
||||
@@ -24,9 +24,12 @@
|
||||
*/
|
||||
package com.iluwatar.model.view.controller;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* Health enumeration.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public enum Health {
|
||||
HEALTHY("healthy"),
|
||||
WOUNDED("wounded"),
|
||||
@@ -34,9 +37,6 @@ public enum Health {
|
||||
|
||||
private final String title;
|
||||
|
||||
Health(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
+3
-3
@@ -24,9 +24,12 @@
|
||||
*/
|
||||
package com.iluwatar.model.view.controller;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
|
||||
/**
|
||||
* Nourishment enumeration.
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
public enum Nourishment {
|
||||
SATURATED("saturated"),
|
||||
HUNGRY("hungry"),
|
||||
@@ -34,9 +37,6 @@ public enum Nourishment {
|
||||
|
||||
private final String title;
|
||||
|
||||
Nourishment(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
Reference in New Issue
Block a user