add lombok to clean codebase
This commit is contained in:
@@ -30,5 +30,12 @@
|
||||
<version>${querydsl.version}</version>
|
||||
<classifier>jakarta</classifier>
|
||||
</dependency>
|
||||
|
||||
<!-- Lombok -->
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -20,6 +20,8 @@ import jakarta.persistence.Transient;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
|
||||
import de.bstly.we.model.UserData;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* The Class BorrowItem.
|
||||
@@ -27,6 +29,8 @@ import de.bstly.we.model.UserData;
|
||||
@Entity
|
||||
@Table(name = "borrow_items")
|
||||
@JsonInclude(JsonInclude.Include.NON_EMPTY)
|
||||
@Getter
|
||||
@Setter
|
||||
public class BorrowItem implements UserData {
|
||||
|
||||
@Id
|
||||
@@ -58,205 +62,7 @@ public class BorrowItem implements UserData {
|
||||
@Transient
|
||||
private List<? extends BorrowItemSlot> slots;
|
||||
|
||||
/**
|
||||
* Gets the id.
|
||||
*
|
||||
* @return the id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the id.
|
||||
*
|
||||
* @param id the new id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the owner.
|
||||
*
|
||||
* @return the owner
|
||||
*/
|
||||
public Long getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the owner.
|
||||
*
|
||||
* @param owner the new owner
|
||||
*/
|
||||
public void setOwner(Long owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name.
|
||||
*
|
||||
* @return the name
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the name.
|
||||
*
|
||||
* @param name the new name
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the description.
|
||||
*
|
||||
* @return the description
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the description.
|
||||
*
|
||||
* @param description the new description
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the url.
|
||||
*
|
||||
* @return the url
|
||||
*/
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the url.
|
||||
*
|
||||
* @param url the new url
|
||||
*/
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the email notification.
|
||||
*
|
||||
* @return the email notification
|
||||
*/
|
||||
public Boolean getEmailNotification() {
|
||||
return emailNotification;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email notification.
|
||||
*
|
||||
* @param emailNotification the new email notification
|
||||
*/
|
||||
public void setEmailNotification(Boolean emailNotification) {
|
||||
this.emailNotification = emailNotification;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the email.
|
||||
*
|
||||
* @return the email
|
||||
*/
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the email.
|
||||
*
|
||||
* @param email the new email
|
||||
*/
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if is auto accept.
|
||||
*
|
||||
* @return true, if is auto accept
|
||||
*/
|
||||
public boolean isAutoAccept() {
|
||||
return autoAccept;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the auto accept.
|
||||
*
|
||||
* @param autoAccept the new auto accept
|
||||
*/
|
||||
public void setAutoAccept(boolean autoAccept) {
|
||||
this.autoAccept = autoAccept;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the min duration.
|
||||
*
|
||||
* @return the min duration
|
||||
*/
|
||||
public Duration getMinDuration() {
|
||||
return minDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the min duration.
|
||||
*
|
||||
* @param minDuration the new min duration
|
||||
*/
|
||||
public void setMinDuration(Duration minDuration) {
|
||||
this.minDuration = minDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the max duration.
|
||||
*
|
||||
* @return the max duration
|
||||
*/
|
||||
public Duration getMaxDuration() {
|
||||
return maxDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the max duration.
|
||||
*
|
||||
* @param maxDuration the new max duration
|
||||
*/
|
||||
public void setMaxDuration(Duration maxDuration) {
|
||||
this.maxDuration = maxDuration;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the availability.
|
||||
*
|
||||
* @return the availability
|
||||
*/
|
||||
public BorrowItemAvailability getAvailability() {
|
||||
return availability;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the availability.
|
||||
*
|
||||
* @param availability the new availability
|
||||
*/
|
||||
public void setAvailability(BorrowItemAvailability availability) {
|
||||
this.availability = availability;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Gets the slots.
|
||||
*
|
||||
* @return the slots
|
||||
@@ -264,14 +70,4 @@ public class BorrowItem implements UserData {
|
||||
public List<? extends BorrowItemSlot> getSlots() {
|
||||
return slots;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the slots.
|
||||
*
|
||||
* @param slots the new slots
|
||||
*/
|
||||
public void setSlots(List<? extends BorrowItemSlot> slots) {
|
||||
this.slots = slots;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,12 +8,16 @@ import java.time.Instant;
|
||||
import jakarta.persistence.Column;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* The Class BorrowItemManualSlot.
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "borrow_item_manual_slots")
|
||||
@Getter
|
||||
@Setter
|
||||
public class BorrowItemManualSlot extends BorrowItemSlot {
|
||||
|
||||
@Column(name = "start")
|
||||
@@ -21,40 +25,4 @@ public class BorrowItemManualSlot extends BorrowItemSlot {
|
||||
@Column(name = "end")
|
||||
private Instant end;
|
||||
|
||||
/**
|
||||
* Gets the start.
|
||||
*
|
||||
* @return the start
|
||||
*/
|
||||
public Instant getStart() {
|
||||
return start;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the start.
|
||||
*
|
||||
* @param start the new start
|
||||
*/
|
||||
public void setStart(Instant start) {
|
||||
this.start = start;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the end.
|
||||
*
|
||||
* @return the end
|
||||
*/
|
||||
public Instant getEnd() {
|
||||
return end;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the end.
|
||||
*
|
||||
* @param end the new end
|
||||
*/
|
||||
public void setEnd(Instant end) {
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,12 +11,16 @@ import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.EnumType;
|
||||
import jakarta.persistence.Enumerated;
|
||||
import jakarta.persistence.Table;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* The Class BorrowItemPeriodSlot.
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "borrow_item_period_slots")
|
||||
@Getter
|
||||
@Setter
|
||||
public class BorrowItemPeriodSlot extends BorrowItemSlot {
|
||||
|
||||
@Column(name = "start_day")
|
||||
@@ -30,76 +34,4 @@ public class BorrowItemPeriodSlot extends BorrowItemSlot {
|
||||
@Column(name = "end_time")
|
||||
private LocalTime endTime;
|
||||
|
||||
/**
|
||||
* Gets the start day.
|
||||
*
|
||||
* @return the start day
|
||||
*/
|
||||
public DayOfWeek getStartDay() {
|
||||
return startDay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the start day.
|
||||
*
|
||||
* @param startDay the new start day
|
||||
*/
|
||||
public void setStartDay(DayOfWeek startDay) {
|
||||
this.startDay = startDay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the start time.
|
||||
*
|
||||
* @return the start time
|
||||
*/
|
||||
public LocalTime getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the start time.
|
||||
*
|
||||
* @param startTime the new start time
|
||||
*/
|
||||
public void setStartTime(LocalTime startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the end day.
|
||||
*
|
||||
* @return the end day
|
||||
*/
|
||||
public DayOfWeek getEndDay() {
|
||||
return endDay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the end day.
|
||||
*
|
||||
* @param endDay the new end day
|
||||
*/
|
||||
public void setEndDay(DayOfWeek endDay) {
|
||||
this.endDay = endDay;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the end time.
|
||||
*
|
||||
* @return the end time
|
||||
*/
|
||||
public LocalTime getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the end time.
|
||||
*
|
||||
* @param endTime the new end time
|
||||
*/
|
||||
public void setEndTime(LocalTime endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -16,6 +16,8 @@ import jakarta.persistence.InheritanceType;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* The Class BorrowItemSlot.
|
||||
@@ -26,6 +28,8 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||
@JsonTypeInfo(use = com.fasterxml.jackson.annotation.JsonTypeInfo.Id.NAME, include = As.PROPERTY, property = "type")
|
||||
@JsonSubTypes({ @JsonSubTypes.Type(value = BorrowItemManualSlot.class, name = "MANUAL"),
|
||||
@JsonSubTypes.Type(value = BorrowItemPeriodSlot.class, name = "PERIOD") })
|
||||
@Getter
|
||||
@Setter
|
||||
public abstract class BorrowItemSlot {
|
||||
|
||||
@Id
|
||||
@@ -35,40 +39,4 @@ public abstract class BorrowItemSlot {
|
||||
@Column(name = "item")
|
||||
private Long item;
|
||||
|
||||
/**
|
||||
* Gets the id.
|
||||
*
|
||||
* @return the id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the id.
|
||||
*
|
||||
* @param id the new id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item.
|
||||
*
|
||||
* @return the item
|
||||
*/
|
||||
public Long getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the item.
|
||||
*
|
||||
* @param item the new item
|
||||
*/
|
||||
public void setItem(Long item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,12 +17,16 @@ import jakarta.persistence.Table;
|
||||
import jakarta.persistence.Transient;
|
||||
|
||||
import de.bstly.we.model.UserData;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* The Class BorrowRequest.
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "borrow_requests")
|
||||
@Getter
|
||||
@Setter
|
||||
public class BorrowRequest implements UserData {
|
||||
|
||||
@Id
|
||||
@@ -49,166 +53,4 @@ public class BorrowRequest implements UserData {
|
||||
@Transient
|
||||
private BorrowItem borrowItem;
|
||||
|
||||
/**
|
||||
* Gets the id.
|
||||
*
|
||||
* @return the id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the id.
|
||||
*
|
||||
* @param id the new id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the item.
|
||||
*
|
||||
* @return the item
|
||||
*/
|
||||
public Long getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the item.
|
||||
*
|
||||
* @param item the new item
|
||||
*/
|
||||
public void setItem(Long item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the user.
|
||||
*
|
||||
* @return the user
|
||||
*/
|
||||
public Long getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the user.
|
||||
*
|
||||
* @param user the new user
|
||||
*/
|
||||
public void setUser(Long user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the status.
|
||||
*
|
||||
* @return the status
|
||||
*/
|
||||
public BorrowRequestStatus getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the status.
|
||||
*
|
||||
* @param status the new status
|
||||
*/
|
||||
public void setStatus(BorrowRequestStatus status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the starts.
|
||||
*
|
||||
* @return the starts
|
||||
*/
|
||||
public Instant getStarts() {
|
||||
return starts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the starts.
|
||||
*
|
||||
* @param starts the new starts
|
||||
*/
|
||||
public void setStarts(Instant starts) {
|
||||
this.starts = starts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ends.
|
||||
*
|
||||
* @return the ends
|
||||
*/
|
||||
public Instant getEnds() {
|
||||
return ends;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ends.
|
||||
*
|
||||
* @param ends the new ends
|
||||
*/
|
||||
public void setEnds(Instant ends) {
|
||||
this.ends = ends;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the reply.
|
||||
*
|
||||
* @return the reply
|
||||
*/
|
||||
public String getReply() {
|
||||
return reply;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the reply.
|
||||
*
|
||||
* @param reply the new reply
|
||||
*/
|
||||
public void setReply(String reply) {
|
||||
this.reply = reply;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the comment.
|
||||
*
|
||||
* @return the comment
|
||||
*/
|
||||
public String getComment() {
|
||||
return comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the comment.
|
||||
*
|
||||
* @param comment the new comment
|
||||
*/
|
||||
public void setComment(String comment) {
|
||||
this.comment = comment;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the borrow item.
|
||||
*
|
||||
* @return the borrow item
|
||||
*/
|
||||
public BorrowItem getBorrowItem() {
|
||||
return borrowItem;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the borrow item.
|
||||
*
|
||||
* @param borrowItem the new borrow item
|
||||
*/
|
||||
public void setBorrowItem(BorrowItem borrowItem) {
|
||||
this.borrowItem = borrowItem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user