From 94380db02dc99ed2621857eb4f37dd549f984b1a Mon Sep 17 00:00:00 2001 From: Sebastiaan de Schaetzen Date: Mon, 2 Mar 2026 18:09:08 +0100 Subject: [PATCH] Use lombok @getter @setter --- .../allowanceplanner/entity/Allowance.java | 60 ++----------------- .../allowanceplanner/entity/History.java | 44 ++------------ .../allowanceplanner/entity/Task.java | 60 ++----------------- .../allowanceplanner/entity/User.java | 36 ++--------- 4 files changed, 16 insertions(+), 184 deletions(-) diff --git a/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/Allowance.java b/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/Allowance.java index 68e02cb..2db2881 100644 --- a/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/Allowance.java +++ b/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/Allowance.java @@ -1,9 +1,13 @@ package be.seeseepuff.allowanceplanner.entity; import jakarta.persistence.*; +import lombok.Getter; +import lombok.Setter; @Entity @Table(name = "allowances") +@Getter +@Setter public class Allowance { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -25,60 +29,4 @@ public class Allowance { private double weight; private Integer colour; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public int getUserId() { - return userId; - } - - public void setUserId(int userId) { - this.userId = userId; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public long getTarget() { - return target; - } - - public void setTarget(long target) { - this.target = target; - } - - public long getBalance() { - return balance; - } - - public void setBalance(long balance) { - this.balance = balance; - } - - public double getWeight() { - return weight; - } - - public void setWeight(double weight) { - this.weight = weight; - } - - public Integer getColour() { - return colour; - } - - public void setColour(Integer colour) { - this.colour = colour; - } } diff --git a/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/History.java b/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/History.java index 6f7340e..c038d03 100644 --- a/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/History.java +++ b/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/History.java @@ -1,9 +1,13 @@ package be.seeseepuff.allowanceplanner.entity; import jakarta.persistence.*; +import lombok.Getter; +import lombok.Setter; @Entity @Table(name = "history") +@Getter +@Setter public class History { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -19,44 +23,4 @@ public class History { private long amount; private String description; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public int getUserId() { - return userId; - } - - public void setUserId(int userId) { - this.userId = userId; - } - - public long getTimestamp() { - return timestamp; - } - - public void setTimestamp(long timestamp) { - this.timestamp = timestamp; - } - - public long getAmount() { - return amount; - } - - public void setAmount(long amount) { - this.amount = amount; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } } diff --git a/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/Task.java b/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/Task.java index da662e1..c4451ab 100644 --- a/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/Task.java +++ b/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/Task.java @@ -1,9 +1,13 @@ package be.seeseepuff.allowanceplanner.entity; import jakarta.persistence.*; +import lombok.Getter; +import lombok.Setter; @Entity @Table(name = "tasks") +@Getter +@Setter public class Task { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -23,60 +27,4 @@ public class Task { @Column(name = "next_run") private Long nextRun; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public long getReward() { - return reward; - } - - public void setReward(long reward) { - this.reward = reward; - } - - public Integer getAssigned() { - return assigned; - } - - public void setAssigned(Integer assigned) { - this.assigned = assigned; - } - - public String getSchedule() { - return schedule; - } - - public void setSchedule(String schedule) { - this.schedule = schedule; - } - - public Long getCompleted() { - return completed; - } - - public void setCompleted(Long completed) { - this.completed = completed; - } - - public Long getNextRun() { - return nextRun; - } - - public void setNextRun(Long nextRun) { - this.nextRun = nextRun; - } } diff --git a/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/User.java b/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/User.java index 8a74483..e55f46b 100644 --- a/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/User.java +++ b/backend-spring/src/main/java/be/seeseepuff/allowanceplanner/entity/User.java @@ -1,9 +1,13 @@ package be.seeseepuff.allowanceplanner.entity; import jakarta.persistence.*; +import lombok.Getter; +import lombok.Setter; @Entity @Table(name = "users") +@Getter +@Setter public class User { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -17,36 +21,4 @@ public class User { @Column(nullable = false) private long balance = 0; - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public double getWeight() { - return weight; - } - - public void setWeight(double weight) { - this.weight = weight; - } - - public long getBalance() { - return balance; - } - - public void setBalance(long balance) { - this.balance = balance; - } }