From c27e68caf01968519c04efb7c8ca7d1e2d81d23b Mon Sep 17 00:00:00 2001 From: _Bastler Date: Sun, 9 Nov 2025 18:40:38 +0100 Subject: [PATCH] add lombok to clean codebase --- borrow/pom.xml | 7 + .../de/bstly/we/borrow/model/BorrowItem.java | 214 +------ .../we/borrow/model/BorrowItemManualSlot.java | 40 +- .../we/borrow/model/BorrowItemPeriodSlot.java | 76 +-- .../bstly/we/borrow/model/BorrowItemSlot.java | 40 +- .../bstly/we/borrow/model/BorrowRequest.java | 166 +----- core/pom.xml | 7 + .../bstly/we/controller/model/ItemModel.java | 31 +- .../we/controller/model/ItemResultModel.java | 41 +- .../bstly/we/controller/model/LoginModel.java | 41 +- .../we/controller/model/PagesResult.java | 85 +-- .../we/controller/model/PasswordModel.java | 58 +- .../controller/model/PasswordResetModel.java | 24 +- .../we/controller/model/PretixRequest.java | 69 +-- .../we/controller/model/ProfileModel.java | 58 +- .../model/SecondFactorProviderModel.java | 54 +- .../bstly/we/controller/model/UserModel.java | 149 +---- .../de/bstly/we/event/AbstractModelEvent.java | 46 +- .../java/de/bstly/we/model/Permission.java | 112 +--- .../de/bstly/we/model/PermissionMapping.java | 220 +------- .../de/bstly/we/model/PersistentLogin.java | 76 +-- .../main/java/de/bstly/we/model/Quota.java | 112 +--- .../java/de/bstly/we/model/QuotaMapping.java | 149 +---- .../de/bstly/we/model/SystemProfileField.java | 58 +- .../de/bstly/we/model/SystemProperty.java | 63 +-- .../src/main/java/de/bstly/we/model/User.java | 129 +---- .../java/de/bstly/we/model/UserAlias.java | 76 +-- .../java/de/bstly/we/model/UserDomain.java | 111 +--- .../de/bstly/we/model/UserProfileField.java | 173 +----- .../main/java/de/bstly/we/model/UserTotp.java | 112 +--- .../de/bstly/we/model/VoucherMapping.java | 94 +--- .../we/security/model/LocalUserDetails.java | 36 +- .../businesslogic/PermissionManagerTest.java | 530 +++++++++--------- dyndns/pom.xml | 7 + .../de/bstly/we/dyndns/model/DyndnsToken.java | 58 +- email/pom.xml | 7 + .../email/controller/model/UserMailModel.java | 59 +- i18n/pom.xml | 7 + .../java/de/bstly/we/i18n/model/I18n.java | 47 +- invite/pom.xml | 7 + .../java/de/bstly/we/invite/model/Invite.java | 238 +------- .../bstly/we/invite/model/InviteMapping.java | 148 +---- jitsi/pom.xml | 7 + .../de/bstly/we/jitsi/model/JitsiRoom.java | 219 +------- jukebox/pom.xml | 7 + .../businesslogic/model/JukeboxConfig.java | 203 +------ .../JukeboxManagementController.java | 3 +- jwt/pom.xml | 7 + .../java/de/bstly/we/jwt/model/JwtKey.java | 202 +------ minetest/pom.xml | 7 + .../we/minetest/model/MinetestAccount.java | 58 +- oidc/pom.xml | 7 + .../businesslogic/OidcSessionManager.java | 4 +- .../InvalidAuthorizationRequestException.java | 76 +-- .../InvalidTokenRequestException.java | 40 +- .../model/OidcAuthorizationCode.java | 98 +--- .../model/OidcAuthorizationRequest.java | 260 +-------- .../businesslogic/model/OidcTokenRequest.java | 119 +--- .../model/OidcTokenResponse.java | 94 +--- .../model/OidcTokenRevokeRequest.java | 41 +- .../oidc/controller/model/OidcClientInfo.java | 239 +------- .../controller/model/OidcClientModel.java | 130 +---- .../controller/model/OidcConfiguration.java | 193 +------ .../we/oidc/model/OidcAuthorization.java | 52 +- .../de/bstly/we/oidc/model/OidcClient.java | 354 +----------- .../de/bstly/we/oidc/model/OidcSession.java | 114 +--- .../de/bstly/we/oidc/model/OidcToken.java | 180 +----- partey/pom.xml | 7 + .../controller/model/CharacterTexture.java | 59 +- .../api/controller/model/MapDetailsData.java | 200 +------ .../api/controller/model/MemberData.java | 190 +------ .../api/controller/model/UserReport.java | 77 +-- .../api/controller/model/WokaCollection.java | 58 +- .../api/controller/model/WokaLayer.java | 41 +- .../api/controller/model/WokaTexture.java | 77 +-- .../we/partey/businesslogic/model/Room.java | 73 +-- .../de/bstly/we/partey/model/ParteyMap.java | 58 +- .../we/partey/model/ParteyUserReport.java | 112 +--- .../model/ParteyUserReportModerator.java | 58 +- .../bstly/we/partey/model/ParteyUserTag.java | 163 +----- .../we/partey/model/ParteyUserTextures.java | 58 +- .../we/partey/timeslot/model/Timeslot.java | 238 +------- pom.xml | 2 +- services/pom.xml | 7 + .../de/bstly/we/services/model/Service.java | 122 +--- urlshortener/pom.xml | 7 + .../controller/model/ShortenedUrlModel.java | 166 +----- .../we/urlshortener/model/ShortenedUrl.java | 169 +----- 88 files changed, 704 insertions(+), 7787 deletions(-) diff --git a/borrow/pom.xml b/borrow/pom.xml index a4440ed..388d50c 100644 --- a/borrow/pom.xml +++ b/borrow/pom.xml @@ -30,5 +30,12 @@ ${querydsl.version} jakarta + + + + org.projectlombok + lombok + true + \ No newline at end of file diff --git a/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItem.java b/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItem.java index 1afb65a..19dc9d8 100644 --- a/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItem.java +++ b/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItem.java @@ -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 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 getSlots() { return slots; } - - /** - * Sets the slots. - * - * @param slots the new slots - */ - public void setSlots(List slots) { - this.slots = slots; - } - } diff --git a/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemManualSlot.java b/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemManualSlot.java index fecc4f7..1cb9707 100644 --- a/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemManualSlot.java +++ b/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemManualSlot.java @@ -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; - } - } diff --git a/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemPeriodSlot.java b/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemPeriodSlot.java index 1b225a7..d586485 100644 --- a/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemPeriodSlot.java +++ b/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemPeriodSlot.java @@ -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; - } - } diff --git a/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemSlot.java b/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemSlot.java index 057d2e2..86e0fbc 100644 --- a/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemSlot.java +++ b/borrow/src/main/java/de/bstly/we/borrow/model/BorrowItemSlot.java @@ -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; - } - } diff --git a/borrow/src/main/java/de/bstly/we/borrow/model/BorrowRequest.java b/borrow/src/main/java/de/bstly/we/borrow/model/BorrowRequest.java index b5fe235..27270fc 100644 --- a/borrow/src/main/java/de/bstly/we/borrow/model/BorrowRequest.java +++ b/borrow/src/main/java/de/bstly/we/borrow/model/BorrowRequest.java @@ -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; - } - } diff --git a/core/pom.xml b/core/pom.xml index 8663f9a..b35e754 100755 --- a/core/pom.xml +++ b/core/pom.xml @@ -111,5 +111,12 @@ spring-boot-starter-test test + + + + org.projectlombok + lombok + true + \ No newline at end of file diff --git a/core/src/main/java/de/bstly/we/controller/model/ItemModel.java b/core/src/main/java/de/bstly/we/controller/model/ItemModel.java index a57f15d..d5b4d85 100644 --- a/core/src/main/java/de/bstly/we/controller/model/ItemModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/ItemModel.java @@ -4,10 +4,14 @@ package de.bstly.we.controller.model; import java.util.Map; +import lombok.Getter; +import lombok.Setter; /** * The Class ItemModel. */ +@Getter +@Setter public class ItemModel { private Map name; @@ -22,31 +26,4 @@ public class ItemModel { return name; } - /** - * Sets the name. - * - * @param name the name - */ - public void setName(Map name) { - this.name = name; - } - - /** - * Gets the secret. - * - * @return the secret - */ - public String getSecret() { - return secret; - } - - /** - * Sets the secret. - * - * @param secret the new secret - */ - public void setSecret(String secret) { - this.secret = secret; - } - } diff --git a/core/src/main/java/de/bstly/we/controller/model/ItemResultModel.java b/core/src/main/java/de/bstly/we/controller/model/ItemResultModel.java index 5b8cff6..87efb46 100644 --- a/core/src/main/java/de/bstly/we/controller/model/ItemResultModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/ItemResultModel.java @@ -7,49 +7,16 @@ import java.util.List; import de.bstly.we.model.PermissionMapping; import de.bstly.we.model.QuotaMapping; +import lombok.Getter; +import lombok.Setter; /** * The Class ItemResultModel. */ +@Getter +@Setter public class ItemResultModel { private List permissionMappings; private List quotaMappings; - - /** - * Gets the permission mappings. - * - * @return the permission mappings - */ - public List getPermissionMappings() { - return permissionMappings; - } - - /** - * Sets the permission mappings. - * - * @param permissionMappings the new permission mappings - */ - public void setPermissionMappings(List permissionMappings) { - this.permissionMappings = permissionMappings; - } - - /** - * Gets the quota mappings. - * - * @return the quota mappings - */ - public List getQuotaMappings() { - return quotaMappings; - } - - /** - * Sets the quota mappings. - * - * @param quotaMappings the new quota mappings - */ - public void setQuotaMappings(List quotaMappings) { - this.quotaMappings = quotaMappings; - } - } diff --git a/core/src/main/java/de/bstly/we/controller/model/LoginModel.java b/core/src/main/java/de/bstly/we/controller/model/LoginModel.java index 2424de3..4c7ca28 100755 --- a/core/src/main/java/de/bstly/we/controller/model/LoginModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/LoginModel.java @@ -3,48 +3,17 @@ */ package de.bstly.we.controller.model; +import lombok.Getter; +import lombok.Setter; + /** * The Class LoginModel. */ +@Getter +@Setter public class LoginModel { private String username; private String password; - /** - * Gets the username. - * - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * Sets the username. - * - * @param username the new username - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * Gets the password. - * - * @return the password - */ - public String getPassword() { - return password; - } - - /** - * Sets the password. - * - * @param password the new password - */ - public void setPassword(String password) { - this.password = password; - } - } diff --git a/core/src/main/java/de/bstly/we/controller/model/PagesResult.java b/core/src/main/java/de/bstly/we/controller/model/PagesResult.java index f471b50..0806bd5 100644 --- a/core/src/main/java/de/bstly/we/controller/model/PagesResult.java +++ b/core/src/main/java/de/bstly/we/controller/model/PagesResult.java @@ -4,12 +4,16 @@ package de.bstly.we.controller.model; import java.util.List; +import lombok.Getter; +import lombok.Setter; /** * The Class PagesResult. * * @param the generic type */ +@Getter +@Setter public class PagesResult { private List result; @@ -27,85 +31,4 @@ public class PagesResult { return result; } - /** - * Sets the result. - * - * @param result the new result - */ - public void setResult(List result) { - this.result = result; - } - - /** - * Gets the size. - * - * @return the size - */ - public int getSize() { - return size; - } - - /** - * Sets the size. - * - * @param size the new size - */ - public void setSize(int size) { - this.size = size; - } - - /** - * Gets the page. - * - * @return the page - */ - public int getPage() { - return page; - } - - /** - * Sets the page. - * - * @param page the new page - */ - public void setPage(int page) { - this.page = page; - } - - /** - * Gets the total elements. - * - * @return the total elements - */ - public int getTotalElements() { - return totalElements; - } - - /** - * Sets the total elements. - * - * @param totalElements the new total elements - */ - public void setTotalElements(int totalElements) { - this.totalElements = totalElements; - } - - /** - * Gets the total pages. - * - * @return the total pages - */ - public int getTotalPages() { - return totalPages; - } - - /** - * Sets the total pages. - * - * @param totalPages the new total pages - */ - public void setTotalPages(int totalPages) { - this.totalPages = totalPages; - } - } diff --git a/core/src/main/java/de/bstly/we/controller/model/PasswordModel.java b/core/src/main/java/de/bstly/we/controller/model/PasswordModel.java index 13d6507..259e932 100755 --- a/core/src/main/java/de/bstly/we/controller/model/PasswordModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/PasswordModel.java @@ -3,66 +3,18 @@ */ package de.bstly.we.controller.model; +import lombok.Getter; +import lombok.Setter; + /** * The Class PasswordModel. */ +@Getter +@Setter public class PasswordModel { private String old; private String password; private String password2; - /** - * Gets the old. - * - * @return the old - */ - public String getOld() { - return old; - } - - /** - * Sets the old. - * - * @param old the new old - */ - public void setOld(String old) { - this.old = old; - } - - /** - * Gets the password. - * - * @return the password - */ - public String getPassword() { - return password; - } - - /** - * Sets the password. - * - * @param password the new password - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * Gets the password 2. - * - * @return the password 2 - */ - public String getPassword2() { - return password2; - } - - /** - * Sets the password 2. - * - * @param password2 the new password 2 - */ - public void setPassword2(String password2) { - this.password2 = password2; - } } diff --git a/core/src/main/java/de/bstly/we/controller/model/PasswordResetModel.java b/core/src/main/java/de/bstly/we/controller/model/PasswordResetModel.java index 9b8b997..f5e044e 100644 --- a/core/src/main/java/de/bstly/we/controller/model/PasswordResetModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/PasswordResetModel.java @@ -3,29 +3,15 @@ */ package de.bstly.we.controller.model; +import lombok.Getter; +import lombok.Setter; + /** * The Class PasswordResetModel. */ +@Getter +@Setter public class PasswordResetModel extends PasswordModel { private String token; - - /** - * Gets the token. - * - * @return the token - */ - public String getToken() { - return token; - } - - /** - * Sets the token. - * - * @param token the new token - */ - public void setToken(String token) { - this.token = token; - } - } diff --git a/core/src/main/java/de/bstly/we/controller/model/PretixRequest.java b/core/src/main/java/de/bstly/we/controller/model/PretixRequest.java index 6379e63..dc4212c 100644 --- a/core/src/main/java/de/bstly/we/controller/model/PretixRequest.java +++ b/core/src/main/java/de/bstly/we/controller/model/PretixRequest.java @@ -6,10 +6,14 @@ package de.bstly.we.controller.model; import java.util.Map; import org.springframework.http.HttpMethod; +import lombok.Getter; +import lombok.Setter; /** * The Class PretixRequest. */ +@Getter +@Setter public class PretixRequest { private String path; @@ -17,43 +21,7 @@ public class PretixRequest { private Map queryParameters; private Object payload; - /** - * Gets the path. - * - * @return the path - */ - public String getPath() { - return path; - } - - /** - * Sets the path. - * - * @param path the new path - */ - public void setPath(String path) { - this.path = path; - } - - /** - * Gets the method. - * - * @return the method - */ - public HttpMethod getMethod() { - return method; - } - - /** - * Sets the method. - * - * @param method the new method - */ - public void setMethod(HttpMethod method) { - this.method = method; - } - - /** +/** * Gets the query parameters. * * @return the query parameters @@ -62,31 +30,4 @@ public class PretixRequest { return queryParameters; } - /** - * Sets the query parameters. - * - * @param queryParameters the query parameters - */ - public void setQueryParameters(Map queryParameters) { - this.queryParameters = queryParameters; - } - - /** - * Gets the payload. - * - * @return the payload - */ - public Object getPayload() { - return payload; - } - - /** - * Sets the payload. - * - * @param payload the new payload - */ - public void setPayload(Object payload) { - this.payload = payload; - } - } diff --git a/core/src/main/java/de/bstly/we/controller/model/ProfileModel.java b/core/src/main/java/de/bstly/we/controller/model/ProfileModel.java index 8c6aa43..742371a 100644 --- a/core/src/main/java/de/bstly/we/controller/model/ProfileModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/ProfileModel.java @@ -6,68 +6,18 @@ package de.bstly.we.controller.model; import java.util.List; import de.bstly.we.model.UserProfileField; +import lombok.Getter; +import lombok.Setter; /** * The Class ProfileModel. */ +@Getter +@Setter public class ProfileModel { private String username; private List aliases; private List profileFields; - /** - * Gets the username. - * - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * Sets the username. - * - * @param username the new username - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * Gets the aliases. - * - * @return the aliases - */ - public List getAliases() { - return aliases; - } - - /** - * Sets the aliases. - * - * @param aliases the new aliases - */ - public void setAliases(List aliases) { - this.aliases = aliases; - } - - /** - * Gets the profile fields. - * - * @return the profile fields - */ - public List getProfileFields() { - return profileFields; - } - - /** - * Sets the profile fields. - * - * @param profileFields the new profile fields - */ - public void setProfileFields(List profileFields) { - this.profileFields = profileFields; - } - } diff --git a/core/src/main/java/de/bstly/we/controller/model/SecondFactorProviderModel.java b/core/src/main/java/de/bstly/we/controller/model/SecondFactorProviderModel.java index 959a47a..f853c9a 100644 --- a/core/src/main/java/de/bstly/we/controller/model/SecondFactorProviderModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/SecondFactorProviderModel.java @@ -3,60 +3,20 @@ */ package de.bstly.we.controller.model; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + /** * The Class SecondFactorProviderModel. */ +@Getter +@Setter +@AllArgsConstructor public class SecondFactorProviderModel { private String id; private boolean request; - /** - * Instantiates a new second factor provider model. - * - * @param id the id - * @param request the request - */ - public SecondFactorProviderModel(String id, boolean request) { - super(); - this.id = id; - this.request = request; - } - - /** - * Gets the id. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Sets the id. - * - * @param id the new id - */ - public void setId(String id) { - this.id = id; - } - - /** - * Checks if is request. - * - * @return true, if is request - */ - public boolean isRequest() { - return request; - } - - /** - * Sets the request. - * - * @param request the new request - */ - public void setRequest(boolean request) { - this.request = request; - } } diff --git a/core/src/main/java/de/bstly/we/controller/model/UserModel.java b/core/src/main/java/de/bstly/we/controller/model/UserModel.java index a5e4b3a..def338e 100755 --- a/core/src/main/java/de/bstly/we/controller/model/UserModel.java +++ b/core/src/main/java/de/bstly/we/controller/model/UserModel.java @@ -11,10 +11,14 @@ import de.bstly.we.model.Quota; import de.bstly.we.model.QuotaMapping; import de.bstly.we.model.UserProfileField; import de.bstly.we.model.UserStatus; +import lombok.Getter; +import lombok.Setter; /** * The Class UserModel. */ +@Getter +@Setter public class UserModel extends PasswordModel { private String username; @@ -25,149 +29,4 @@ public class UserModel extends PasswordModel { private UserStatus status; private String token; private List profileFields; - - /** - * Gets the username. - * - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * Sets the username. - * - * @param username the new username - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * Gets the permissions. - * - * @return the permissions - */ - public List getPermissions() { - return permissions; - } - - /** - * Sets the permissions. - * - * @param permissions the new permissions - */ - public void setPermissions(List permissions) { - this.permissions = permissions; - } - - /** - * Gets the permission mappings. - * - * @return the permission mappings - */ - public List getPermissionMappings() { - return permissionMappings; - } - - /** - * Sets the permission mappings. - * - * @param permissionMappings the new permission mappings - */ - public void setPermissionMappings(List permissionMappings) { - this.permissionMappings = permissionMappings; - } - - /** - * Gets the quotas. - * - * @return the quotas - */ - public List getQuotas() { - return quotas; - } - - /** - * Sets the quotas. - * - * @param quotas the new quotas - */ - public void setQuotas(List quotas) { - this.quotas = quotas; - } - - /** - * Gets the quota mappings. - * - * @return the quota mappings - */ - public List getQuotaMappings() { - return quotaMappings; - } - - /** - * Sets the quota mappings. - * - * @param quotaMappings the new quota mappings - */ - public void setQuotaMappings(List quotaMappings) { - this.quotaMappings = quotaMappings; - } - - /** - * Gets the status. - * - * @return the status - */ - public UserStatus getStatus() { - return status; - } - - /** - * Sets the status. - * - * @param status the new status - */ - public void setStatus(UserStatus status) { - this.status = status; - } - - /** - * Gets the token. - * - * @return the token - */ - public String getToken() { - return token; - } - - /** - * Sets the token. - * - * @param token the new token - */ - public void setToken(String token) { - this.token = token; - } - - /** - * Gets the profile fields. - * - * @return the profile fields - */ - public List getProfileFields() { - return profileFields; - } - - /** - * Sets the profile fields. - * - * @param profileFields the new profile fields - */ - public void setProfileFields(List profileFields) { - this.profileFields = profileFields; - } - } diff --git a/core/src/main/java/de/bstly/we/event/AbstractModelEvent.java b/core/src/main/java/de/bstly/we/event/AbstractModelEvent.java index 4e725e3..3426c3e 100644 --- a/core/src/main/java/de/bstly/we/event/AbstractModelEvent.java +++ b/core/src/main/java/de/bstly/we/event/AbstractModelEvent.java @@ -6,10 +6,14 @@ package de.bstly.we.event; import org.springframework.context.ApplicationEvent; import de.bstly.we.model.AbstractModel; +import lombok.Getter; +import lombok.Setter; /** * The Class AbstractModelEvent. */ +@Getter +@Setter public class AbstractModelEvent extends ApplicationEvent { /** @@ -20,52 +24,10 @@ public class AbstractModelEvent extends ApplicationEvent { private AbstractModelEventType type; private AbstractModel model; - /** - * Instantiates a new abstract model event. - * - * @param type the type - * @param model the model - */ public AbstractModelEvent(AbstractModelEventType type, AbstractModel model) { super(model); this.type = type; this.model = model; } - /** - * Gets the type. - * - * @return the type - */ - public AbstractModelEventType getType() { - return type; - } - - /** - * Sets the type. - * - * @param type the new type - */ - public void setType(AbstractModelEventType type) { - this.type = type; - } - - /** - * Gets the model. - * - * @return the model - */ - public AbstractModel getModel() { - return model; - } - - /** - * Sets the model. - * - * @param model the new model - */ - public void setModel(AbstractModel model) { - this.model = model; - } - } diff --git a/core/src/main/java/de/bstly/we/model/Permission.java b/core/src/main/java/de/bstly/we/model/Permission.java index 27decf1..8a6036a 100755 --- a/core/src/main/java/de/bstly/we/model/Permission.java +++ b/core/src/main/java/de/bstly/we/model/Permission.java @@ -11,12 +11,16 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class Permission. */ @Entity @Table(name = "permissions") +@Getter +@Setter public class Permission implements UserData { @Id @@ -34,112 +38,4 @@ public class Permission implements UserData { @Column(name = "expires") private Instant expires; - /** - * 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 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 target. - * - * @return the target - */ - public Long getTarget() { - return target; - } - - /** - * Sets the target. - * - * @param target the new target - */ - public void setTarget(Long target) { - this.target = target; - } - - /** - * Checks if is addon. - * - * @return true, if is addon - */ - public boolean isAddon() { - return addon; - } - - /** - * Sets the addon. - * - * @param addon the new addon - */ - public void setAddon(boolean addon) { - this.addon = addon; - } - - /** - * 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 expires. - * - * @return the expires - */ - public Instant getExpires() { - return expires; - } - - /** - * Sets the expires. - * - * @param expires the new expires - */ - public void setExpires(Instant expires) { - this.expires = expires; - } - } diff --git a/core/src/main/java/de/bstly/we/model/PermissionMapping.java b/core/src/main/java/de/bstly/we/model/PermissionMapping.java index 3de7a54..181df70 100755 --- a/core/src/main/java/de/bstly/we/model/PermissionMapping.java +++ b/core/src/main/java/de/bstly/we/model/PermissionMapping.java @@ -19,12 +19,16 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class PermissionMapping. */ @Entity @Table(name = "permission_mappings") +@Getter +@Setter public class PermissionMapping { public static final ChronoUnit DEFAULT_LIFETIME_UNIT = ChronoUnit.DAYS; @@ -58,222 +62,6 @@ public class PermissionMapping { @Column(name = "expires_question") private String expiresQuestion; - /** - * 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 product. - * - * @return the product - */ - public String getProduct() { - return product; - } - - /** - * Sets the product. - * - * @param product the new product - */ - public void setProduct(String product) { - this.product = product; - } - - /** - * Gets the item. - * - * @return the item - */ - public Integer getItem() { - return item; - } - - /** - * Sets the item. - * - * @param item the new item - */ - public void setItem(Integer item) { - this.item = item; - } - - /** - * Gets the names. - * - * @return the names - */ - public Set getNames() { - return names; - } - - /** - * Sets the names. - * - * @param names the new names - */ - public void setNames(Set names) { - this.names = names; - } - - /** - * Checks if is addon. - * - * @return true, if is addon - */ - public boolean isAddon() { - return addon; - } - - /** - * Sets the addon. - * - * @param addon the new addon - */ - public void setAddon(boolean addon) { - this.addon = addon; - } - - /** - * Gets the lifetime. - * - * @return the lifetime - */ - public Long getLifetime() { - return lifetime; - } - - /** - * Sets the lifetime. - * - * @param lifetime the new lifetime - */ - public void setLifetime(Long lifetime) { - this.lifetime = lifetime; - } - - /** - * Gets the lifetime unit. - * - * @return the lifetime unit - */ - public ChronoUnit getLifetimeUnit() { - return lifetimeUnit; - } - - /** - * Sets the lifetime unit. - * - * @param lifetimeUnit the new lifetime unit - */ - public void setLifetimeUnit(ChronoUnit lifetimeUnit) { - this.lifetimeUnit = lifetimeUnit; - } - - /** - * Checks if is lifetime round. - * - * @return true, if is lifetime round - */ - public boolean isLifetimeRound() { - return lifetimeRound; - } - - /** - * Sets the lifetime round. - * - * @param lifetimeRound the new lifetime round - */ - public void setLifetimeRound(boolean lifetimeRound) { - this.lifetimeRound = lifetimeRound; - } - - /** - * 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 expires. - * - * @return the expires - */ - public Instant getExpires() { - return expires; - } - - /** - * Sets the expires. - * - * @param expires the new expires - */ - public void setExpires(Instant expires) { - this.expires = expires; - } - - /** - * Gets the starts question. - * - * @return the starts question - */ - public String getStartsQuestion() { - return startsQuestion; - } - - /** - * Sets the starts question. - * - * @param startsQuestion the new starts question - */ - public void setStartsQuestion(String startsQuestion) { - this.startsQuestion = startsQuestion; - } - - /** - * Gets the expires question. - * - * @return the expires question - */ - public String getExpiresQuestion() { - return expiresQuestion; - } - - /** - * Sets the expires question. - * - * @param expiresQuestion the new expires question - */ - public void setExpiresQuestion(String expiresQuestion) { - this.expiresQuestion = expiresQuestion; - } - /** * The Class ChronoUnitConverter. */ diff --git a/core/src/main/java/de/bstly/we/model/PersistentLogin.java b/core/src/main/java/de/bstly/we/model/PersistentLogin.java index f157671..1cf5ee6 100644 --- a/core/src/main/java/de/bstly/we/model/PersistentLogin.java +++ b/core/src/main/java/de/bstly/we/model/PersistentLogin.java @@ -9,12 +9,16 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class PersistentLogin. */ @Entity @Table(name = "persistent_logins") +@Getter +@Setter public class PersistentLogin { @Column(name = "username", length = 64, nullable = false) @@ -27,76 +31,4 @@ public class PersistentLogin { @Column(name = "last_used", nullable = false) private Instant last_used; - /** - * Gets the username. - * - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * Sets the username. - * - * @param username the new username - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * Gets the series. - * - * @return the series - */ - public String getSeries() { - return series; - } - - /** - * Sets the series. - * - * @param series the new series - */ - public void setSeries(String series) { - this.series = series; - } - - /** - * Gets the token. - * - * @return the token - */ - public String getToken() { - return token; - } - - /** - * Sets the token. - * - * @param token the new token - */ - public void setToken(String token) { - this.token = token; - } - - /** - * Gets the last used. - * - * @return the last used - */ - public Instant getLast_used() { - return last_used; - } - - /** - * Sets the last used. - * - * @param last_used the new last used - */ - public void setLast_used(Instant last_used) { - this.last_used = last_used; - } - } diff --git a/core/src/main/java/de/bstly/we/model/Quota.java b/core/src/main/java/de/bstly/we/model/Quota.java index 1258e5e..4caf584 100644 --- a/core/src/main/java/de/bstly/we/model/Quota.java +++ b/core/src/main/java/de/bstly/we/model/Quota.java @@ -9,12 +9,16 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class Quota. */ @Entity @Table(name = "quotas") +@Getter +@Setter public class Quota implements UserData { @Id @@ -32,112 +36,4 @@ public class Quota implements UserData { @Column(name = "disposable", columnDefinition = "boolean default false") private boolean disposable; - /** - * 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 target. - * - * @return the target - */ - public Long getTarget() { - return target; - } - - /** - * Sets the target. - * - * @param target the new target - */ - public void setTarget(Long target) { - this.target = target; - } - - /** - * 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 value. - * - * @return the value - */ - public long getValue() { - return value; - } - - /** - * Sets the value. - * - * @param value the new value - */ - public void setValue(long value) { - this.value = value; - } - - /** - * Gets the unit. - * - * @return the unit - */ - public String getUnit() { - return unit; - } - - /** - * Sets the unit. - * - * @param unit the new unit - */ - public void setUnit(String unit) { - this.unit = unit; - } - - /** - * Checks if is disposable. - * - * @return true, if is disposable - */ - public boolean isDisposable() { - return disposable; - } - - /** - * Sets the disposable. - * - * @param disposable the new disposable - */ - public void setDisposable(boolean disposable) { - this.disposable = disposable; - } - } diff --git a/core/src/main/java/de/bstly/we/model/QuotaMapping.java b/core/src/main/java/de/bstly/we/model/QuotaMapping.java index e788d03..7b27535 100644 --- a/core/src/main/java/de/bstly/we/model/QuotaMapping.java +++ b/core/src/main/java/de/bstly/we/model/QuotaMapping.java @@ -14,12 +14,16 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class QuotaMapping. */ @Entity @Table(name = "quota_mappings") +@Getter +@Setter public class QuotaMapping { @Id @@ -42,149 +46,4 @@ public class QuotaMapping { private boolean append; @Column(name = "disposable", columnDefinition = "boolean default false") private boolean disposable; - - /** - * 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 products. - * - * @return the products - */ - public Set getProducts() { - return products; - } - - /** - * Sets the products. - * - * @param products the new products - */ - public void setProducts(Set products) { - this.products = products; - } - - /** - * Gets the items. - * - * @return the items - */ - public Set getItems() { - return items; - } - - /** - * Sets the items. - * - * @param items the new items - */ - public void setItems(Set items) { - this.items = items; - } - - /** - * 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 value. - * - * @return the value - */ - public long getValue() { - return value; - } - - /** - * Sets the value. - * - * @param value the new value - */ - public void setValue(long value) { - this.value = value; - } - - /** - * Gets the unit. - * - * @return the unit - */ - public String getUnit() { - return unit; - } - - /** - * Sets the unit. - * - * @param unit the new unit - */ - public void setUnit(String unit) { - this.unit = unit; - } - - /** - * Checks if is append. - * - * @return true, if is append - */ - public boolean isAppend() { - return append; - } - - /** - * Sets the append. - * - * @param append the new append - */ - public void setAppend(boolean append) { - this.append = append; - } - - /** - * Checks if is disposable. - * - * @return true, if is disposable - */ - public boolean isDisposable() { - return disposable; - } - - /** - * Sets the disposable. - * - * @param disposable the new disposable - */ - public void setDisposable(boolean disposable) { - this.disposable = disposable; - } - } diff --git a/core/src/main/java/de/bstly/we/model/SystemProfileField.java b/core/src/main/java/de/bstly/we/model/SystemProfileField.java index 8604f7b..09e9f8f 100644 --- a/core/src/main/java/de/bstly/we/model/SystemProfileField.java +++ b/core/src/main/java/de/bstly/we/model/SystemProfileField.java @@ -7,12 +7,16 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class SystemProfileField. */ @Entity @Table(name = "system_profile_fields") +@Getter +@Setter public class SystemProfileField { @Id @@ -23,58 +27,4 @@ public class SystemProfileField { @Column(name = "unique_value", columnDefinition = "boolean default false") private boolean uniqueValue; - /** - * 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 type. - * - * @return the type - */ - public ProfileFieldType getType() { - return type; - } - - /** - * Sets the type. - * - * @param type the new type - */ - public void setType(ProfileFieldType type) { - this.type = type; - } - - /** - * Checks if is unique value. - * - * @return true, if is unique value - */ - public boolean isUniqueValue() { - return uniqueValue; - } - - /** - * Sets the unique value. - * - * @param uniqueValue the new unique value - */ - public void setUniqueValue(boolean uniqueValue) { - this.uniqueValue = uniqueValue; - } - } diff --git a/core/src/main/java/de/bstly/we/model/SystemProperty.java b/core/src/main/java/de/bstly/we/model/SystemProperty.java index 8254e37..283bf04 100755 --- a/core/src/main/java/de/bstly/we/model/SystemProperty.java +++ b/core/src/main/java/de/bstly/we/model/SystemProperty.java @@ -8,12 +8,20 @@ import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.Lob; import jakarta.persistence.Table; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; /** * The Class SystemProperty. */ @Entity @Table(name = "system_properties") +@Getter +@Setter +@NoArgsConstructor +@AllArgsConstructor public class SystemProperty { @Id @@ -23,59 +31,4 @@ public class SystemProperty { @Column(name = "value", length = 100000) private String value; - /** - * Instantiates a new system property. - */ - public SystemProperty() { - super(); - } - - /** - * Instantiates a new system property. - * - * @param key the key - * @param value the value - */ - public SystemProperty(String key, String value) { - super(); - this.key = key; - this.value = value; - } - - /** - * Gets the key. - * - * @return the key - */ - public String getKey() { - return key; - } - - /** - * Sets the key. - * - * @param key the new key - */ - public void setKey(String key) { - this.key = key; - } - - /** - * Gets the value. - * - * @return the value - */ - public String getValue() { - return value; - } - - /** - * Sets the value. - * - * @param value the new value - */ - public void setValue(String value) { - this.value = value; - } - } diff --git a/core/src/main/java/de/bstly/we/model/User.java b/core/src/main/java/de/bstly/we/model/User.java index 1fc4dae..398906c 100755 --- a/core/src/main/java/de/bstly/we/model/User.java +++ b/core/src/main/java/de/bstly/we/model/User.java @@ -12,12 +12,16 @@ import jakarta.persistence.Table; import jakarta.persistence.UniqueConstraint; import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Getter; +import lombok.Setter; /** * The Class User. */ @Entity @Table(name = "users", uniqueConstraints = @UniqueConstraint(columnNames = { "username" })) +@Getter +@Setter public class User implements UserData { @Id @@ -38,129 +42,4 @@ public class User implements UserData { @Column(name = "reset_token") private String resetToken; - /** - * 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 username. - * - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * Sets the username. - * - * @param username the new username - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * Gets the password hash. - * - * @return the password hash - */ - public String getPasswordHash() { - return passwordHash; - } - - /** - * Sets the password hash. - * - * @param passwordHash the new password hash - */ - public void setPasswordHash(String passwordHash) { - this.passwordHash = passwordHash; - } - - /** - * Checks if is disabled. - * - * @return true, if is disabled - */ - public boolean isDisabled() { - return disabled; - } - - /** - * Sets the disabled. - * - * @param disabled the new disabled - */ - public void setDisabled(boolean disabled) { - this.disabled = disabled; - } - - /** - * Checks if is locked. - * - * @return true, if is locked - */ - public boolean isLocked() { - return locked; - } - - /** - * Sets the locked. - * - * @param locked the new locked - */ - public void setLocked(boolean locked) { - this.locked = locked; - } - - /** - * Gets the status. - * - * @return the status - */ - public UserStatus getStatus() { - return status; - } - - /** - * Sets the status. - * - * @param status the new status - */ - public void setStatus(UserStatus status) { - this.status = status; - } - - /** - * Gets the reset token. - * - * @return the reset token - */ - public String getResetToken() { - return resetToken; - } - - /** - * Sets the reset token. - * - * @param resetToken the new reset token - */ - public void setResetToken(String resetToken) { - this.resetToken = resetToken; - } } diff --git a/core/src/main/java/de/bstly/we/model/UserAlias.java b/core/src/main/java/de/bstly/we/model/UserAlias.java index 7da64cd..1339566 100644 --- a/core/src/main/java/de/bstly/we/model/UserAlias.java +++ b/core/src/main/java/de/bstly/we/model/UserAlias.java @@ -10,12 +10,16 @@ import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; import jakarta.persistence.UniqueConstraint; +import lombok.Getter; +import lombok.Setter; /** * The Class UserAlias. */ @Entity @Table(name = "aliases", uniqueConstraints = @UniqueConstraint(columnNames = { "alias" })) +@Getter +@Setter public class UserAlias implements UserData { @Id @@ -29,76 +33,4 @@ public class UserAlias implements UserData { @Column(name = "visibility", nullable = false) private Visibility visibility = Visibility.PROTECTED; - /** - * 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 target. - * - * @return the target - */ - public Long getTarget() { - return target; - } - - /** - * Sets the target. - * - * @param target the new target - */ - public void setTarget(Long target) { - this.target = target; - } - - /** - * Gets the alias. - * - * @return the alias - */ - public String getAlias() { - return alias; - } - - /** - * Sets the alias. - * - * @param alias the new alias - */ - public void setAlias(String alias) { - this.alias = alias; - } - - /** - * Gets the visibility. - * - * @return the visibility - */ - public Visibility getVisibility() { - return visibility; - } - - /** - * Sets the visibility. - * - * @param visibility the new visibility - */ - public void setVisibility(Visibility visibility) { - this.visibility = visibility; - } - } diff --git a/core/src/main/java/de/bstly/we/model/UserDomain.java b/core/src/main/java/de/bstly/we/model/UserDomain.java index 34cff49..05f71dd 100644 --- a/core/src/main/java/de/bstly/we/model/UserDomain.java +++ b/core/src/main/java/de/bstly/we/model/UserDomain.java @@ -10,12 +10,16 @@ import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; import jakarta.persistence.UniqueConstraint; +import lombok.Getter; +import lombok.Setter; /** * The Class UserDomain. */ @Entity @Table(name = "domains", uniqueConstraints = @UniqueConstraint(columnNames = { "domain" })) +@Getter +@Setter public class UserDomain implements UserData { @Id @@ -33,111 +37,4 @@ public class UserDomain implements UserData { @Column(name = "validated", columnDefinition = "boolean default false") private boolean validated; - /** - * 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 target. - * - * @return the target - */ - public Long getTarget() { - return target; - } - - /** - * Sets the target. - * - * @param target the new target - */ - public void setTarget(Long target) { - this.target = target; - } - - /** - * Gets the domain. - * - * @return the domain - */ - public String getDomain() { - return domain; - } - - /** - * Sets the domain. - * - * @param domain the new domain - */ - public void setDomain(String domain) { - this.domain = domain; - } - - /** - * Gets the visibility. - * - * @return the visibility - */ - public Visibility getVisibility() { - return visibility; - } - - /** - * Sets the visibility. - * - * @param visibility the new visibility - */ - public void setVisibility(Visibility visibility) { - this.visibility = visibility; - } - - /** - * Gets the secret. - * - * @return the secret - */ - public String getSecret() { - return secret; - } - - /** - * Sets the secret. - * - * @param secret the new secret - */ - public void setSecret(String secret) { - this.secret = secret; - } - - /** - * Checks if is validated. - * - * @return true, if is validated - */ - public boolean isValidated() { - return validated; - } - - /** - * Sets the validated. - * - * @param validated the new validated - */ - public void setValidated(boolean validated) { - this.validated = validated; - } } diff --git a/core/src/main/java/de/bstly/we/model/UserProfileField.java b/core/src/main/java/de/bstly/we/model/UserProfileField.java index 02f9992..1a95087 100644 --- a/core/src/main/java/de/bstly/we/model/UserProfileField.java +++ b/core/src/main/java/de/bstly/we/model/UserProfileField.java @@ -5,6 +5,7 @@ package de.bstly.we.model; import java.io.Serializable; +import de.bstly.we.model.UserProfileField.UserProfileFieldId; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Id; @@ -12,8 +13,8 @@ import jakarta.persistence.IdClass; import jakarta.persistence.Lob; import jakarta.persistence.Table; import jakarta.persistence.UniqueConstraint; - -import de.bstly.we.model.UserProfileField.UserProfileFieldId; +import lombok.Getter; +import lombok.Setter; /** * The Class UserProfileField. @@ -21,6 +22,8 @@ import de.bstly.we.model.UserProfileField.UserProfileFieldId; @Entity @IdClass(UserProfileFieldId.class) @Table(name = "profile_fields", uniqueConstraints = @UniqueConstraint(columnNames = { "target", "name" })) +@Getter +@Setter public class UserProfileField implements UserData { @Id @@ -32,7 +35,7 @@ public class UserProfileField implements UserData { @Column(name = "value", nullable = true) private String value; @Lob - @Column(name = "blob_value", nullable = true, length = 100000) + @Column(name = "blob_value", nullable = true, length = 100000) private String blob; @Column(name = "type", nullable = false) private ProfileFieldType type; @@ -41,135 +44,11 @@ public class UserProfileField implements UserData { @Column(name = "order_index", nullable = true) private Integer index = 0; - /** - * 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 target. - * - * @return the target - */ - public Long getTarget() { - return target; - } - - /** - * Sets the target. - * - * @param target the new target - */ - public void setTarget(Long target) { - this.target = target; - } - - /** - * Gets the value. - * - * @return the value - */ - public String getValue() { - return value; - } - - /** - * Sets the value. - * - * @param value the new value - */ - public void setValue(String value) { - this.value = value; - } - - /** - * Gets the blob. - * - * @return the blob - */ - public String getBlob() { - return blob; - } - - /** - * Sets the blob. - * - * @param blob the new blob - */ - public void setBlob(String blob) { - this.blob = blob; - } - - /** - * Gets the type. - * - * @return the type - */ - public ProfileFieldType getType() { - return type; - } - - /** - * Sets the type. - * - * @param type the new type - */ - public void setType(ProfileFieldType type) { - this.type = type; - } - - /** - * Gets the visibility. - * - * @return the visibility - */ - public Visibility getVisibility() { - return visibility; - } - - /** - * Sets the visibility. - * - * @param visibility the new visibility - */ - public void setVisibility(Visibility visibility) { - this.visibility = visibility; - } - - /** - * Gets the index. - * - * @return the index - */ - public Integer getIndex() { - return index; - } - - /** - * Sets the index. - * - * @param index the new index - */ - public void setIndex(Integer index) { - this.index = index; - } - /** * The Class UserProfileFieldId. */ + @Getter + @Setter public static class UserProfileFieldId implements Serializable { /** @@ -179,42 +58,6 @@ public class UserProfileField implements UserData { private Long target; private String name; - /** - * Gets the target. - * - * @return the target - */ - public Long getTarget() { - return target; - } - - /** - * Sets the target. - * - * @param target the new target - */ - public void setTarget(Long target) { - this.target = target; - } - - /** - * 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; - } - /* * @see java.lang.Object#equals(java.lang.Object) */ diff --git a/core/src/main/java/de/bstly/we/model/UserTotp.java b/core/src/main/java/de/bstly/we/model/UserTotp.java index 3bfda5e..9c8ef2e 100644 --- a/core/src/main/java/de/bstly/we/model/UserTotp.java +++ b/core/src/main/java/de/bstly/we/model/UserTotp.java @@ -15,12 +15,16 @@ import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; import jakarta.persistence.UniqueConstraint; +import lombok.Getter; +import lombok.Setter; /** * The Class UserTotp. */ @Entity @Table(name = "user_totps", uniqueConstraints = @UniqueConstraint(columnNames = { "target" })) +@Getter +@Setter public class UserTotp implements SecondFactor { @Id @@ -37,112 +41,4 @@ public class UserTotp implements SecondFactor { @CollectionTable(name = "user_totps_recovery_codes") private List recoveryCodes; - /** - * 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 target. - * - * @return the target - */ - public Long getTarget() { - return target; - } - - /** - * Sets the target. - * - * @param target the new target - */ - public void setTarget(Long target) { - this.target = target; - } - - /** - * Checks if is enabled. - * - * @return true, if is enabled - */ - public boolean isEnabled() { - return enabled; - } - - /** - * Sets the enabled. - * - * @param enabled the new enabled - */ - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - - /** - * Gets the secret. - * - * @return the secret - */ - public String getSecret() { - return secret; - } - - /** - * Sets the secret. - * - * @param secret the new secret - */ - public void setSecret(String secret) { - this.secret = secret; - } - - /** - * Gets the qr data. - * - * @return the qr data - */ - public String getQrData() { - return qrData; - } - - /** - * Sets the qr data. - * - * @param qrData the new qr data - */ - public void setQrData(String qrData) { - this.qrData = qrData; - } - - /** - * Gets the recovery codes. - * - * @return the recovery codes - */ - public List getRecoveryCodes() { - return recoveryCodes; - } - - /** - * Sets the recovery codes. - * - * @param recoveryCodes the new recovery codes - */ - public void setRecoveryCodes(List recoveryCodes) { - this.recoveryCodes = recoveryCodes; - } - } diff --git a/core/src/main/java/de/bstly/we/model/VoucherMapping.java b/core/src/main/java/de/bstly/we/model/VoucherMapping.java index c97566d..6364be2 100644 --- a/core/src/main/java/de/bstly/we/model/VoucherMapping.java +++ b/core/src/main/java/de/bstly/we/model/VoucherMapping.java @@ -9,12 +9,16 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class VoucherMapping. */ @Entity @Table(name = "voucher_mappings") +@Getter +@Setter public class VoucherMapping { @Id @@ -30,94 +34,4 @@ public class VoucherMapping { @Column(name = "free", columnDefinition = "boolean default false") private boolean free; - /** - * 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 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 quota. - * - * @return the quota - */ - public String getQuota() { - return quota; - } - - /** - * Sets the quota. - * - * @param quota the new quota - */ - public void setQuota(String quota) { - this.quota = quota; - } - - /** - * Gets the voucher. - * - * @return the voucher - */ - public int getVoucher() { - return voucher; - } - - /** - * Sets the voucher. - * - * @param voucher the new voucher - */ - public void setVoucher(int voucher) { - this.voucher = voucher; - } - - /** - * Checks if is free. - * - * @return true, if is free - */ - public boolean isFree() { - return free; - } - - /** - * Sets the free. - * - * @param free the new free - */ - public void setFree(boolean free) { - this.free = free; - } - } diff --git a/core/src/main/java/de/bstly/we/security/model/LocalUserDetails.java b/core/src/main/java/de/bstly/we/security/model/LocalUserDetails.java index 817db0e..a9726f3 100755 --- a/core/src/main/java/de/bstly/we/security/model/LocalUserDetails.java +++ b/core/src/main/java/de/bstly/we/security/model/LocalUserDetails.java @@ -7,10 +7,14 @@ import java.util.Collection; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.userdetails.User; +import lombok.Getter; +import lombok.Setter; /** * The Class LocalUserDetails. */ +@Getter +@Setter public class LocalUserDetails extends User { /** @@ -36,36 +40,4 @@ public class LocalUserDetails extends User { this.alias = alias; } - /** - * Gets the user id. - * - * @return the user id - */ - public Long getUserId() { - return userId; - } - - /** - * Sets the user id. - * - * @param userId the new user id - */ - public void setUserId(Long userId) { - this.userId = userId; - } - - /** - * @return the alias - */ - public String getAlias() { - return alias; - } - - /** - * @param alias the alias to set - */ - public void setAlias(String alias) { - this.alias = alias; - } - } diff --git a/core/src/test/java/de/bstly/we/businesslogic/PermissionManagerTest.java b/core/src/test/java/de/bstly/we/businesslogic/PermissionManagerTest.java index dafcb47..9567799 100644 --- a/core/src/test/java/de/bstly/we/businesslogic/PermissionManagerTest.java +++ b/core/src/test/java/de/bstly/we/businesslogic/PermissionManagerTest.java @@ -1,8 +1,11 @@ package de.bstly.we.businesslogic; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.ArgumentMatchers.*; -import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; import java.time.Instant; import java.time.temporal.ChronoUnit; @@ -11,7 +14,6 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.InjectMocks; @@ -23,273 +25,289 @@ import com.google.gson.JsonArray; import de.bstly.we.model.Permission; import de.bstly.we.model.PermissionMapping; -import de.bstly.we.model.QPermission; import de.bstly.we.repository.PermissionRepository; @ExtendWith(MockitoExtension.class) class PermissionManagerTest { - @Mock - private PermissionRepository permissionRepository; + @Mock + private PermissionRepository permissionRepository; - @Mock - private PermissionMappingManager permissionMappingManager; + @Mock + private PermissionMappingManager permissionMappingManager; - @InjectMocks - private PermissionManager permissionManager; + @InjectMocks + private PermissionManager permissionManager; - private static final Long TARGET_USER_ID = 1L; - private static final Integer TEST_ITEM_ID = 1; - private static final String ROLE_MEMBER = "ROLE_MEMBER"; + private static final Long TARGET_USER_ID = 1L; + private static final Integer TEST_ITEM_ID = 1; + private static final String ROLE_MEMBER = "ROLE_MEMBER"; - @Test - void testGetForItem_NewAddonPermission_CreatesNewWhenNoExisting() { - // Given - Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); - PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true); - when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); - - // No existing permissions - when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) - .thenReturn(Arrays.asList()); + @Test + void testGetForItem_NewAddonPermission_CreatesNewWhenNoExisting() { + // Given + Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); + PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true); + when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); - // When - List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), - currentTime, null); + // No existing permissions + when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) + .thenReturn(Arrays.asList()); - // Then - assertEquals(1, result.size()); - Permission permission = result.get(0); - assertEquals(TARGET_USER_ID, permission.getTarget()); - assertEquals(ROLE_MEMBER, permission.getName()); - assertTrue(permission.isAddon()); // Should be addon since no existing permission found - - // Should create new permission with 1 year from current time: March 15, 2025 + 1 year = March 15, 2026 - Instant expectedExpiry = Instant.parse("2026-03-15T10:00:00Z"); - assertEquals(expectedExpiry, permission.getExpires()); - } + // When + List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), + currentTime, null); - @Test - void testGetForItem_AddonExtendsValidPermission_Simple() { - // Given - existing valid permission that expires on June 15, 2025 - Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); - Instant existingExpiry = Instant.parse("2025-06-15T10:00:00Z"); // 3 months in the future - Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, existingExpiry); - - PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true); - when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); - when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) - .thenReturn(Arrays.asList(existingPermission)); + // Then + assertEquals(1, result.size()); + Permission permission = result.get(0); + assertEquals(TARGET_USER_ID, permission.getTarget()); + assertEquals(ROLE_MEMBER, permission.getName()); + assertTrue(permission.isAddon()); // Should be addon since no existing permission found - // When - List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), - currentTime, null); - - // Then - assertEquals(1, result.size()); - Permission extendedPermission = result.get(0); - assertEquals(existingPermission, extendedPermission); // Should be the same object (extended) - - // Should extend by exactly 1 year from current expiry: June 15, 2025 + 1 year = June 15, 2026 - Instant expectedExpiry = Instant.parse("2026-06-15T10:00:00Z"); - assertEquals(expectedExpiry, extendedPermission.getExpires()); - assertEquals(TARGET_USER_ID, extendedPermission.getTarget()); - assertEquals(ROLE_MEMBER, extendedPermission.getName()); - } - - @Test - void testGetForItem_AddonExtendsExpiredPermission_SimpleCase() { - // Given - existing permission that expired on February 15, 2025 (1 month ago from March 15) - Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); - Instant expiredDate = Instant.parse("2025-02-15T10:00:00Z"); // Expired exactly 1 month ago - Permission expiredPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, expiredDate); - - PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true); - when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); - when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) - .thenReturn(Arrays.asList(expiredPermission)); - - // When - List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), - currentTime, null); - - // Then - assertEquals(1, result.size()); - Permission extendedPermission = result.get(0); - assertEquals(expiredPermission, extendedPermission); // Should be the same object (extended) - - // Should extend by exactly 1 year from original expiry: Feb 15, 2025 + 1 year = Feb 15, 2026 - Instant expectedExpiry = Instant.parse("2026-02-15T10:00:00Z"); - assertEquals(expectedExpiry, extendedPermission.getExpires()); - assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future - } - - @Test - void testGetForItem_AddonExtendsLongExpiredPermission_CatchesUp() { - // Given - permission that expired 2 years ago (Dec 31, 2023, applied in Nov 2025) - Instant currentTime = Instant.parse("2025-02-09T10:00:00Z"); - Instant longExpiredDate = Instant.parse("2023-12-31T23:59:59Z"); - Permission longExpiredPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, longExpiredDate); - - PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true); - when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); - when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) - .thenReturn(Arrays.asList(longExpiredPermission)); - - // When - List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), - currentTime, null); - - // Then - assertEquals(1, result.size()); - Permission extendedPermission = result.get(0); - assertEquals(longExpiredPermission, extendedPermission); // Should be the same object (extended) - - // Should "catch up" to future: 2023-12-31 -> 2024-12-31 -> 2025-12-31 (first future date) - Instant expectedExpiry = Instant.parse("2025-12-31T23:59:59Z"); - assertEquals(expectedExpiry, extendedPermission.getExpires()); - assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future - } - - - @Test - void testGetForItem_AddonExtendsNonExpiredPermission_CatchesUp() { - // Given - permission that expired 2 years ago (Dec 31, 2023, applied in Nov 2025) - Instant currentTime = Instant.parse("2025-02-09T10:00:00Z"); - Instant expiredDate = Instant.parse("2025-12-31T23:59:59Z"); - Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, expiredDate); - - PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true); - when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); - when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) - .thenReturn(Arrays.asList(existingPermission)); - - // When - List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), - currentTime, null); - - // Then - assertEquals(1, result.size()); - Permission extendedPermission = result.get(0); - assertEquals(existingPermission, extendedPermission); // Should be the same object (extended) - - // Should "catch up" to future: 2025-12-31 -> 2026-12-31 (first future date) - Instant expectedExpiry = Instant.parse("2026-12-31T23:59:59Z"); - assertEquals(expectedExpiry, extendedPermission.getExpires()); - assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future - } - - @Test - void testGetForItem_AddonSelectsLatestExpiringPermission() { - // Given - multiple existing permissions with different expiry dates - Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); - Permission permission1 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, Instant.parse("2025-06-23T10:00:00Z")); // 100 days - Permission permission2 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, Instant.parse("2025-10-01T10:00:00Z")); // 200 days (latest) - Permission permission3 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, Instant.parse("2025-05-04T10:00:00Z")); // 50 days - - PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 6L, ChronoUnit.MONTHS, true); - when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); - when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) - .thenReturn(Arrays.asList(permission1, permission2, permission3)); - - // When - List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), - currentTime, null); - - // Then - assertEquals(1, result.size()); - Permission selectedPermission = result.get(0); - assertEquals(permission2, selectedPermission); // Should select the one with latest expiry (Oct 1, 2025) - - // Should extend by 6 months from latest expiry: Oct 1, 2025 + 6 months = April 1, 2026 - Instant expectedExpiry = Instant.parse("2026-04-01T10:00:00Z"); - assertEquals(expectedExpiry, selectedPermission.getExpires()); - assertEquals(TARGET_USER_ID, selectedPermission.getTarget()); - assertEquals(ROLE_MEMBER, selectedPermission.getName()); - } - - @Test - void testGetForItem_NonAddonCreatesNewPermission() { - // Given - Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); - PermissionMapping nonAddonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, false); // Not addon - when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(nonAddonMapping)); - - // Existing permission exists but should be ignored since this is not an addon - Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, Instant.parse("2025-06-23T10:00:00Z")); - when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) - .thenReturn(Arrays.asList(existingPermission)); - - // When - List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), - currentTime, null); - - // Then - assertEquals(1, result.size()); - Permission newPermission = result.get(0); - assertNotEquals(existingPermission, newPermission); // Should be a new permission object - assertEquals(TARGET_USER_ID, newPermission.getTarget()); - assertEquals(ROLE_MEMBER, newPermission.getName()); - assertFalse(newPermission.isAddon()); // Should not be addon - - // Should create new permission with 1 year from current time: March 15, 2025 + 1 year = March 15, 2026 - Instant expectedExpiry = Instant.parse("2026-03-15T10:00:00Z"); - assertEquals(expectedExpiry, newPermission.getExpires()); - } - - @Test - void testGetForItem_MultiplePermissionNames() { - // Given - mapping with multiple permission names - Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); - Set permissionNames = new HashSet<>(Arrays.asList("ROLE_MEMBER", "ROLE_SPECIAL")); - PermissionMapping multiMapping = createPermissionMapping(permissionNames, 1L, ChronoUnit.YEARS, true); - when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(multiMapping)); - - when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) - .thenReturn(Arrays.asList()); // No existing permissions - - // When - List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), - currentTime, null); - - // Then - assertEquals(2, result.size()); - - // Should have both permission names - Set resultNames = new HashSet<>(); - for (Permission p : result) { - resultNames.add(p.getName()); - assertEquals(TARGET_USER_ID, p.getTarget()); - assertTrue(p.isAddon()); + // Should create new permission with 1 year from current time: March 15, 2025 + + // 1 year = March 15, 2026 + Instant expectedExpiry = Instant.parse("2026-03-15T10:00:00Z"); + assertEquals(expectedExpiry, permission.getExpires()); } - assertEquals(permissionNames, resultNames); - } - // Helper methods - private Permission createPermission(Long target, String name, boolean addon, Instant starts, Instant expires) { - Permission permission = new Permission(); - permission.setTarget(target); - permission.setName(name); - permission.setAddon(addon); - permission.setStarts(starts); - permission.setExpires(expires); - return permission; - } + @Test + void testGetForItem_AddonExtendsValidPermission_Simple() { + // Given - existing valid permission that expires on June 15, 2025 + Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); + Instant existingExpiry = Instant.parse("2025-06-15T10:00:00Z"); // 3 months in the future + Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, + existingExpiry); - private PermissionMapping createAddonPermissionMapping(String permissionName, Long lifetime, ChronoUnit unit, boolean isAddon) { - Set names = new HashSet<>(); - names.add(permissionName); - return createPermissionMapping(names, lifetime, unit, isAddon); - } + PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true); + when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); + when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) + .thenReturn(Arrays.asList(existingPermission)); - private PermissionMapping createPermissionMapping(Set names, Long lifetime, ChronoUnit unit, boolean isAddon) { - PermissionMapping mapping = new PermissionMapping(); - mapping.setItem(TEST_ITEM_ID); - mapping.setNames(names); - mapping.setLifetime(lifetime); - mapping.setLifetimeUnit(unit); - mapping.setAddon(isAddon); - mapping.setLifetimeRound(false); - return mapping; - } + // When + List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), + currentTime, null); + + // Then + assertEquals(1, result.size()); + Permission extendedPermission = result.get(0); + assertEquals(existingPermission, extendedPermission); // Should be the same object (extended) + + // Should extend by exactly 1 year from current expiry: June 15, 2025 + 1 year = + // June 15, 2026 + Instant expectedExpiry = Instant.parse("2026-06-15T10:00:00Z"); + assertEquals(expectedExpiry, extendedPermission.getExpires()); + assertEquals(TARGET_USER_ID, extendedPermission.getTarget()); + assertEquals(ROLE_MEMBER, extendedPermission.getName()); + } + + @Test + void testGetForItem_AddonExtendsExpiredPermission_SimpleCase() { + // Given - existing permission that expired on February 15, 2025 (1 month ago + // from March 15) + Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); + Instant expiredDate = Instant.parse("2025-02-15T10:00:00Z"); // Expired exactly 1 month ago + Permission expiredPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, expiredDate); + + PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true); + when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); + when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) + .thenReturn(Arrays.asList(expiredPermission)); + + // When + List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), + currentTime, null); + + // Then + assertEquals(1, result.size()); + Permission extendedPermission = result.get(0); + assertEquals(expiredPermission, extendedPermission); // Should be the same object (extended) + + // Should extend by exactly 1 year from original expiry: Feb 15, 2025 + 1 year = + // Feb 15, 2026 + Instant expectedExpiry = Instant.parse("2026-02-15T10:00:00Z"); + assertEquals(expectedExpiry, extendedPermission.getExpires()); + assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future + } + + @Test + void testGetForItem_AddonExtendsLongExpiredPermission_CatchesUp() { + // Given - permission that expired 2 years ago (Dec 31, 2023, applied in Nov + // 2025) + Instant currentTime = Instant.parse("2025-02-09T10:00:00Z"); + Instant longExpiredDate = Instant.parse("2023-12-31T23:59:59Z"); + Permission longExpiredPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, + longExpiredDate); + + PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true); + when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); + when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) + .thenReturn(Arrays.asList(longExpiredPermission)); + + // When + List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), + currentTime, null); + + // Then + assertEquals(1, result.size()); + Permission extendedPermission = result.get(0); + assertEquals(longExpiredPermission, extendedPermission); // Should be the same object (extended) + + // Should "catch up" to future: 2023-12-31 -> 2024-12-31 -> 2025-12-31 (first + // future date) + Instant expectedExpiry = Instant.parse("2025-12-31T23:59:59Z"); + assertEquals(expectedExpiry, extendedPermission.getExpires()); + assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future + } + + @Test + void testGetForItem_AddonExtendsNonExpiredPermission_CatchesUp() { + // Given - permission that expired 2 years ago (Dec 31, 2023, applied in Nov + // 2025) + Instant currentTime = Instant.parse("2025-02-09T10:00:00Z"); + Instant expiredDate = Instant.parse("2025-12-31T23:59:59Z"); + Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, expiredDate); + + PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, true); + when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); + when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) + .thenReturn(Arrays.asList(existingPermission)); + + // When + List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), + currentTime, null); + + // Then + assertEquals(1, result.size()); + Permission extendedPermission = result.get(0); + assertEquals(existingPermission, extendedPermission); // Should be the same object (extended) + + // Should "catch up" to future: 2025-12-31 -> 2026-12-31 (first future date) + Instant expectedExpiry = Instant.parse("2026-12-31T23:59:59Z"); + assertEquals(expectedExpiry, extendedPermission.getExpires()); + assertTrue(extendedPermission.getExpires().isAfter(currentTime)); // Should be in the future + } + + @Test + void testGetForItem_AddonSelectsLatestExpiringPermission() { + // Given - multiple existing permissions with different expiry dates + Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); + Permission permission1 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, + Instant.parse("2025-06-23T10:00:00Z")); // 100 days + Permission permission2 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, + Instant.parse("2025-10-01T10:00:00Z")); // 200 days (latest) + Permission permission3 = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, + Instant.parse("2025-05-04T10:00:00Z")); // 50 days + + PermissionMapping addonMapping = createAddonPermissionMapping(ROLE_MEMBER, 6L, ChronoUnit.MONTHS, true); + when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(addonMapping)); + when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) + .thenReturn(Arrays.asList(permission1, permission2, permission3)); + + // When + List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), + currentTime, null); + + // Then + assertEquals(1, result.size()); + Permission selectedPermission = result.get(0); + assertEquals(permission2, selectedPermission); // Should select the one with latest expiry (Oct 1, 2025) + + // Should extend by 6 months from latest expiry: Oct 1, 2025 + 6 months = April + // 1, 2026 + Instant expectedExpiry = Instant.parse("2026-04-01T10:00:00Z"); + assertEquals(expectedExpiry, selectedPermission.getExpires()); + assertEquals(TARGET_USER_ID, selectedPermission.getTarget()); + assertEquals(ROLE_MEMBER, selectedPermission.getName()); + } + + @Test + void testGetForItem_NonAddonCreatesNewPermission() { + // Given + Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); + PermissionMapping nonAddonMapping = createAddonPermissionMapping(ROLE_MEMBER, 1L, ChronoUnit.YEARS, + false); // Not addon + when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(nonAddonMapping)); + + // Existing permission exists but should be ignored since this is not an addon + Permission existingPermission = createPermission(TARGET_USER_ID, ROLE_MEMBER, false, null, + Instant.parse("2025-06-23T10:00:00Z")); + when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) + .thenReturn(Arrays.asList(existingPermission)); + + // When + List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), + currentTime, null); + + // Then + assertEquals(1, result.size()); + Permission newPermission = result.get(0); + assertNotEquals(existingPermission, newPermission); // Should be a new permission object + assertEquals(TARGET_USER_ID, newPermission.getTarget()); + assertEquals(ROLE_MEMBER, newPermission.getName()); + assertFalse(newPermission.isAddon()); // Should not be addon + + // Should create new permission with 1 year from current time: March 15, 2025 + + // 1 year = March 15, 2026 + Instant expectedExpiry = Instant.parse("2026-03-15T10:00:00Z"); + assertEquals(expectedExpiry, newPermission.getExpires()); + } + + @Test + void testGetForItem_MultiplePermissionNames() { + // Given - mapping with multiple permission names + Instant currentTime = Instant.parse("2025-03-15T10:00:00Z"); + Set permissionNames = new HashSet<>(Arrays.asList("ROLE_MEMBER", "ROLE_SPECIAL")); + PermissionMapping multiMapping = createPermissionMapping(permissionNames, 1L, ChronoUnit.YEARS, true); + when(permissionMappingManager.getAllByItem(TEST_ITEM_ID)).thenReturn(Arrays.asList(multiMapping)); + + when(permissionRepository.findAll(any(com.querydsl.core.types.Predicate.class), any(Sort.class))) + .thenReturn(Arrays.asList()); // No existing permissions + + // When + List result = permissionManager.getForItem(TARGET_USER_ID, TEST_ITEM_ID, new JsonArray(), + currentTime, null); + + // Then + assertEquals(2, result.size()); + + // Should have both permission names + Set resultNames = new HashSet<>(); + for (Permission p : result) { + resultNames.add(p.getName()); + assertEquals(TARGET_USER_ID, p.getTarget()); + assertTrue(p.isAddon()); + } + assertEquals(permissionNames, resultNames); + } + + // Helper methods + private Permission createPermission(Long target, String name, boolean addon, Instant starts, Instant expires) { + Permission permission = new Permission(); + permission.setTarget(target); + permission.setName(name); + permission.setAddon(addon); + permission.setStarts(starts); + permission.setExpires(expires); + return permission; + } + + private PermissionMapping createAddonPermissionMapping(String permissionName, Long lifetime, ChronoUnit unit, + boolean isAddon) { + Set names = new HashSet<>(); + names.add(permissionName); + return createPermissionMapping(names, lifetime, unit, isAddon); + } + + private PermissionMapping createPermissionMapping(Set names, Long lifetime, ChronoUnit unit, + boolean isAddon) { + PermissionMapping mapping = new PermissionMapping(); + mapping.setItem(TEST_ITEM_ID); + mapping.setNames(names); + mapping.setLifetime(lifetime); + mapping.setLifetimeUnit(unit); + mapping.setAddon(isAddon); + mapping.setLifetimeRound(false); + return mapping; + } } \ No newline at end of file diff --git a/dyndns/pom.xml b/dyndns/pom.xml index bd3fa0d..a7a233a 100755 --- a/dyndns/pom.xml +++ b/dyndns/pom.xml @@ -31,5 +31,12 @@ ${querydsl.version} jakarta + + + + org.projectlombok + lombok + true + \ No newline at end of file diff --git a/dyndns/src/main/java/de/bstly/we/dyndns/model/DyndnsToken.java b/dyndns/src/main/java/de/bstly/we/dyndns/model/DyndnsToken.java index ec0912e..0cce247 100644 --- a/dyndns/src/main/java/de/bstly/we/dyndns/model/DyndnsToken.java +++ b/dyndns/src/main/java/de/bstly/we/dyndns/model/DyndnsToken.java @@ -13,6 +13,8 @@ import jakarta.persistence.EntityListeners; import jakarta.persistence.Id; import jakarta.persistence.Table; import jakarta.persistence.Transient; +import lombok.Getter; +import lombok.Setter; /** * The Class DyndnsToken. @@ -20,6 +22,8 @@ import jakarta.persistence.Transient; @Entity @Table(name = "dyndns_tokens") @EntityListeners(AbstractModelEventListener.class) +@Getter +@Setter public class DyndnsToken implements UserData { @Id @@ -30,59 +34,5 @@ public class DyndnsToken implements UserData { private String tokenHash; @Transient private String token; - - /** - * 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 token hash. - * - * @return the token hash - */ - public String getTokenHash() { - return tokenHash; - } - - /** - * Sets the token hash. - * - * @param tokenHash the new token hash - */ - public void setTokenHash(String tokenHash) { - this.tokenHash = tokenHash; - } - - /** - * Gets the token. - * - * @return the token - */ - public String getToken() { - return token; - } - - /** - * Sets the token. - * - * @param token the new token - */ - public void setToken(String token) { - this.token = token; - } } diff --git a/email/pom.xml b/email/pom.xml index 16a979e..1e27f6f 100755 --- a/email/pom.xml +++ b/email/pom.xml @@ -22,5 +22,12 @@ org.springframework.boot spring-boot-starter-mail + + + + org.projectlombok + lombok + true + diff --git a/email/src/main/java/de/bstly/we/email/controller/model/UserMailModel.java b/email/src/main/java/de/bstly/we/email/controller/model/UserMailModel.java index 87f1e05..33f15af 100644 --- a/email/src/main/java/de/bstly/we/email/controller/model/UserMailModel.java +++ b/email/src/main/java/de/bstly/we/email/controller/model/UserMailModel.java @@ -3,9 +3,14 @@ */ package de.bstly.we.email.controller.model; +import lombok.Getter; +import lombok.Setter; + /** * The Class UserMailModel. */ +@Getter +@Setter public class UserMailModel { private String username; @@ -24,58 +29,4 @@ public class UserMailModel { this.email = email; } - /** - * Gets the username. - * - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * Sets the username. - * - * @param username the new username - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * 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; - } - - /** - * Gets the locale. - * - * @return the locale - */ - public String getLocale() { - return locale; - } - - /** - * Sets the locale. - * - * @param locale the new locale - */ - public void setLocale(String locale) { - this.locale = locale; - } - } diff --git a/i18n/pom.xml b/i18n/pom.xml index 93303db..c930583 100644 --- a/i18n/pom.xml +++ b/i18n/pom.xml @@ -25,5 +25,12 @@ ${querydsl.version} jakarta + + + + org.projectlombok + lombok + true + diff --git a/i18n/src/main/java/de/bstly/we/i18n/model/I18n.java b/i18n/src/main/java/de/bstly/we/i18n/model/I18n.java index 4fa8592..38a53ab 100644 --- a/i18n/src/main/java/de/bstly/we/i18n/model/I18n.java +++ b/i18n/src/main/java/de/bstly/we/i18n/model/I18n.java @@ -9,62 +9,23 @@ import jakarta.persistence.Id; import jakarta.persistence.Lob; import jakarta.persistence.Table; import jakarta.persistence.UniqueConstraint; +import lombok.Getter; +import lombok.Setter; /** * The Class I18n. */ @Entity @Table(name = "i18n", uniqueConstraints = @UniqueConstraint(columnNames = { "locale" })) +@Getter +@Setter public class I18n { - /** - * - */ @Id @Column(name = "locale", unique = true, nullable = false) private String locale; - - /** - * - */ @Lob @Column(name = "label", length = 100000) private String label; - /** - * Gets the locale. - * - * @return the locale - */ - public String getLocale() { - return locale; - } - - /** - * Sets the locale. - * - * @param locale the new locale - */ - public void setLocale(String locale) { - this.locale = locale; - } - - /** - * Gets the label. - * - * @return the label - */ - public String getLabel() { - return label; - } - - /** - * Sets the label. - * - * @param label the new label - */ - public void setLabel(String label) { - this.label = label; - } - } diff --git a/invite/pom.xml b/invite/pom.xml index 8ae4cac..1feff70 100755 --- a/invite/pom.xml +++ b/invite/pom.xml @@ -25,5 +25,12 @@ ${querydsl.version} jakarta + + + + org.projectlombok + lombok + true + diff --git a/invite/src/main/java/de/bstly/we/invite/model/Invite.java b/invite/src/main/java/de/bstly/we/invite/model/Invite.java index c38526a..6d25138 100644 --- a/invite/src/main/java/de/bstly/we/invite/model/Invite.java +++ b/invite/src/main/java/de/bstly/we/invite/model/Invite.java @@ -14,12 +14,16 @@ import jakarta.persistence.Lob; import jakarta.persistence.Table; import de.bstly.we.model.UserData; +import lombok.Getter; +import lombok.Setter; /** * The Class Invite. */ @Entity @Table(name = "invites") +@Getter +@Setter public class Invite implements UserData { @Id @@ -41,238 +45,4 @@ public class Invite implements UserData { private String codeLink; private String url; - /** - * 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 code. - * - * @return the code - */ - public String getCode() { - return code; - } - - /** - * Sets the code. - * - * @param code the new code - */ - public void setCode(String code) { - this.code = code; - } - - /** - * Gets the item. - * - * @return the item - */ - public Integer getItem() { - return item; - } - - /** - * Sets the item. - * - * @param item the new item - */ - public void setItem(Integer item) { - this.item = item; - } - - /** - * Gets the quota. - * - * @return the quota - */ - public String getQuota() { - return quota; - } - - /** - * Sets the quota. - * - * @param quota the new quota - */ - public void setQuota(String quota) { - this.quota = quota; - } - - /** - * 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 expires. - * - * @return the expires - */ - public Instant getExpires() { - return expires; - } - - /** - * Sets the expires. - * - * @param expires the new expires - */ - public void setExpires(Instant expires) { - this.expires = expires; - } - - /** - * Gets the message. - * - * @return the message - */ - public String getMessage() { - return message; - } - - /** - * Sets the message. - * - * @param message the new message - */ - public void setMessage(String message) { - this.message = message; - } - - /** - * Gets the note. - * - * @return the note - */ - public String getNote() { - return note; - } - - /** - * Sets the note. - * - * @param note the new note - */ - public void setNote(String note) { - this.note = note; - } - - /** - * Checks if is redeemed. - * - * @return true, if is redeemed - */ - public boolean isRedeemed() { - return redeemed; - } - - /** - * Sets the redeemed. - * - * @param redeemed the new redeemed - */ - public void setRedeemed(boolean redeemed) { - this.redeemed = redeemed; - } - - /** - * Gets the redeemed by. - * - * @return the redeemed by - */ - public Long getRedeemedBy() { - return redeemedBy; - } - - /** - * Sets the redeemed by. - * - * @param redeemedBy the new redeemed by - */ - public void setRedeemedBy(Long redeemedBy) { - this.redeemedBy = redeemedBy; - } - - /** - * Gets the code link. - * - * @return the code link - */ - public String getCodeLink() { - return codeLink; - } - - /** - * Sets the code link. - * - * @param codeLink the new code link - */ - public void setCodeLink(String codeLink) { - this.codeLink = codeLink; - } - - /** - * 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; - } - } diff --git a/invite/src/main/java/de/bstly/we/invite/model/InviteMapping.java b/invite/src/main/java/de/bstly/we/invite/model/InviteMapping.java index 1955ff0..aa23878 100644 --- a/invite/src/main/java/de/bstly/we/invite/model/InviteMapping.java +++ b/invite/src/main/java/de/bstly/we/invite/model/InviteMapping.java @@ -9,12 +9,16 @@ import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class InviteMapping. */ @Entity @Table(name = "invite_mapping") +@Getter +@Setter public class InviteMapping { public static final String QUOTA_PREFIX = "invite_"; @@ -30,148 +34,4 @@ public class InviteMapping { private String url; private String defaultMessage; - /** - * Gets the quota. - * - * @return the quota - */ - public String getQuota() { - return quota; - } - - /** - * Sets the quota. - * - * @param quota the new quota - */ - public void setQuota(String quota) { - this.quota = quota; - } - - /** - * Gets the item. - * - * @return the item - */ - public Integer getItem() { - return item; - } - - /** - * Sets the item. - * - * @param item the new item - */ - public void setItem(Integer item) { - this.item = item; - } - - /** - * 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 expires. - * - * @return the expires - */ - public Instant getExpires() { - return expires; - } - - /** - * Sets the expires. - * - * @param expires the new expires - */ - public void setExpires(Instant expires) { - this.expires = expires; - } - - /** - * Gets the message limit. - * - * @return the message limit - */ - public Integer getMessageLimit() { - return messageLimit; - } - - /** - * Sets the message limit. - * - * @param messageLimit the new message limit - */ - public void setMessageLimit(Integer messageLimit) { - this.messageLimit = messageLimit; - } - - /** - * Gets the code link. - * - * @return the code link - */ - public String getCodeLink() { - return codeLink; - } - - /** - * Sets the code link. - * - * @param codeLink the new code link - */ - public void setCodeLink(String codeLink) { - this.codeLink = codeLink; - } - - /** - * 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 default message. - * - * @return the default message - */ - public String getDefaultMessage() { - return defaultMessage; - } - - /** - * Sets the default message. - * - * @param defaultMessage the new default message - */ - public void setDefaultMessage(String defaultMessage) { - this.defaultMessage = defaultMessage; - } - } diff --git a/jitsi/pom.xml b/jitsi/pom.xml index 32b064a..f02edfd 100755 --- a/jitsi/pom.xml +++ b/jitsi/pom.xml @@ -36,5 +36,12 @@ ${querydsl.version} jakarta + + + + org.projectlombok + lombok + true + diff --git a/jitsi/src/main/java/de/bstly/we/jitsi/model/JitsiRoom.java b/jitsi/src/main/java/de/bstly/we/jitsi/model/JitsiRoom.java index 2ad565c..fb04dde 100644 --- a/jitsi/src/main/java/de/bstly/we/jitsi/model/JitsiRoom.java +++ b/jitsi/src/main/java/de/bstly/we/jitsi/model/JitsiRoom.java @@ -18,12 +18,16 @@ import org.springframework.data.annotation.Reference; import com.fasterxml.jackson.annotation.JsonIgnore; import de.bstly.we.model.UserData; +import lombok.Getter; +import lombok.Setter; /** * The Class JitsiRoom. */ @Entity @Table(name = "jitsi_rooms") +@Getter +@Setter public class JitsiRoom implements UserData { @Id @@ -55,219 +59,4 @@ public class JitsiRoom implements UserData { @Column(length = 100000) private String orgUrl; - /** - * 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 room. - * - * @return the room - */ - public String getRoom() { - return room; - } - - /** - * Sets the room. - * - * @param room the new room - */ - public void setRoom(String room) { - this.room = room; - } - - /** - * 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 moderation starts. - * - * @return the moderation starts - */ - public Instant getModerationStarts() { - return moderationStarts; - } - - /** - * Sets the moderation starts. - * - * @param moderationStarts the new moderation starts - */ - public void setModerationStarts(Instant moderationStarts) { - this.moderationStarts = moderationStarts; - } - - /** - * Gets the expires. - * - * @return the expires - */ - public Instant getExpires() { - return expires; - } - - /** - * Sets the expires. - * - * @param expires the new expires - */ - public void setExpires(Instant expires) { - this.expires = expires; - } - - /** - * Gets the token. - * - * @return the token - */ - public String getToken() { - return token; - } - - /** - * Sets the token. - * - * @param token the new token - */ - public void setToken(String token) { - this.token = token; - } - - /** - * Gets the moderation token. - * - * @return the moderation token - */ - public String getModerationToken() { - return moderationToken; - } - - /** - * Sets the moderation token. - * - * @param moderationToken the new moderation token - */ - public void setModerationToken(String moderationToken) { - this.moderationToken = moderationToken; - } - - /** - * 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 moderation url. - * - * @return the moderation url - */ - public String getModerationUrl() { - return moderationUrl; - } - - /** - * Sets the moderation url. - * - * @param moderationUrl the new moderation url - */ - public void setModerationUrl(String moderationUrl) { - this.moderationUrl = moderationUrl; - } - - /** - * Gets the code. - * - * @return the code - */ - public String getCode() { - return code; - } - - /** - * Sets the code. - * - * @param code the new code - */ - public void setCode(String code) { - this.code = code; - } - - /** - * Gets the org url. - * - * @return the org url - */ - public String getOrgUrl() { - return orgUrl; - } - - /** - * Sets the org url. - * - * @param orgUrl the new org url - */ - public void setOrgUrl(String orgUrl) { - this.orgUrl = orgUrl; - } } diff --git a/jukebox/pom.xml b/jukebox/pom.xml index 3626cf8..43ba731 100644 --- a/jukebox/pom.xml +++ b/jukebox/pom.xml @@ -17,5 +17,12 @@ webstly-partey ${revision} + + + + org.projectlombok + lombok + true + diff --git a/jukebox/src/main/java/de/bstly/we/jukebox/businesslogic/model/JukeboxConfig.java b/jukebox/src/main/java/de/bstly/we/jukebox/businesslogic/model/JukeboxConfig.java index fdb2c41..2262cac 100644 --- a/jukebox/src/main/java/de/bstly/we/jukebox/businesslogic/model/JukeboxConfig.java +++ b/jukebox/src/main/java/de/bstly/we/jukebox/businesslogic/model/JukeboxConfig.java @@ -5,9 +5,14 @@ package de.bstly.we.jukebox.businesslogic.model; import java.time.Instant; +import lombok.Getter; +import lombok.Setter; + /** * The Class JukeboxConfig. */ +@Getter +@Setter public class JukeboxConfig { private String clientId; @@ -22,202 +27,4 @@ public class JukeboxConfig { private Instant expires; private String fallbackContextId; - /** - * Gets the client id. - * - * @return the client id - */ - public String getClientId() { - return clientId; - } - - /** - * Sets the client id. - * - * @param clientId the new client id - */ - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * Gets the client secret. - * - * @return the client secret - */ - public String getClientSecret() { - return clientSecret; - } - - /** - * Sets the client secret. - * - * @param clientSecret the new client secret - */ - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - /** - * Gets the device id. - * - * @return the device id - */ - public String getDeviceId() { - return deviceId; - } - - /** - * Sets the device id. - * - * @param deviceId the new device id - */ - public void setDeviceId(String deviceId) { - this.deviceId = deviceId; - } - - /** - * Gets the redirect url. - * - * @return the redirect url - */ - public String getRedirectUrl() { - return redirectUrl; - } - - /** - * Sets the redirect url. - * - * @param redirectUrl the new redirect url - */ - public void setRedirectUrl(String redirectUrl) { - this.redirectUrl = redirectUrl; - } - - /** - * Gets the api url. - * - * @return the api url - */ - public String getApiUrl() { - return apiUrl; - } - - /** - * Sets the api url. - * - * @param apiUrl the new api url - */ - public void setApiUrl(String apiUrl) { - this.apiUrl = apiUrl; - } - - /** - * Gets the account url. - * - * @return the account url - */ - public String getAccountUrl() { - return accountUrl; - } - - /** - * Sets the account url. - * - * @param accountUrl the new account url - */ - public void setAccountUrl(String accountUrl) { - this.accountUrl = accountUrl; - } - - /** - * Checks if is active. - * - * @return true, if is active - */ - public boolean isActive() { - return active; - } - - /** - * Sets the active. - * - * @param active the new active - */ - public void setActive(boolean active) { - this.active = active; - } - - /** - * Gets the access token. - * - * @return the access token - */ - public String getAccessToken() { - return accessToken; - } - - /** - * Sets the access token. - * - * @param accessToken the new access token - */ - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - /** - * Gets the refresh token. - * - * @return the refresh token - */ - public String getRefreshToken() { - return refreshToken; - } - - /** - * Sets the refresh token. - * - * @param refreshToken the new refresh token - */ - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - /** - * Gets the expires. - * - * @return the expires - */ - public Instant getExpires() { - return expires; - } - - /** - * Sets the expires. - * - * @param expires the new expires - */ - public void setExpires(Instant expires) { - this.expires = expires; - } - - /** - * Gets the fallback context id. - * - * @return the fallback context id - */ - public String getFallbackContextId() { - return fallbackContextId; - } - - /** - * Sets the fallback context id. - * - * @param fallbackContextId the new fallback context id - */ - public void setFallbackContextId(String fallbackContextId) { - this.fallbackContextId = fallbackContextId; - } - } diff --git a/jukebox/src/main/java/de/bstly/we/jukebox/controller/JukeboxManagementController.java b/jukebox/src/main/java/de/bstly/we/jukebox/controller/JukeboxManagementController.java index 8a276a0..e8e59d6 100644 --- a/jukebox/src/main/java/de/bstly/we/jukebox/controller/JukeboxManagementController.java +++ b/jukebox/src/main/java/de/bstly/we/jukebox/controller/JukeboxManagementController.java @@ -6,8 +6,6 @@ package de.bstly.we.jukebox.controller; import java.io.IOException; import java.util.Optional; -import jakarta.servlet.http.HttpServletResponse; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.DeleteMapping; @@ -25,6 +23,7 @@ import com.google.gson.JsonIOException; import de.bstly.we.controller.BaseController; import de.bstly.we.jukebox.businesslogic.JukeboxManager; import de.bstly.we.jukebox.businesslogic.model.JukeboxConfig; +import jakarta.servlet.http.HttpServletResponse; /** * The Class JukeboxManagementController. diff --git a/jwt/pom.xml b/jwt/pom.xml index 997b5da..9283012 100644 --- a/jwt/pom.xml +++ b/jwt/pom.xml @@ -32,5 +32,12 @@ jakarta provided + + + + org.projectlombok + lombok + true + \ No newline at end of file diff --git a/jwt/src/main/java/de/bstly/we/jwt/model/JwtKey.java b/jwt/src/main/java/de/bstly/we/jwt/model/JwtKey.java index d3c7dd3..cfe58e0 100644 --- a/jwt/src/main/java/de/bstly/we/jwt/model/JwtKey.java +++ b/jwt/src/main/java/de/bstly/we/jwt/model/JwtKey.java @@ -16,12 +16,16 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class JwtKey. */ @Entity @Table(name = "jwt_keys") +@Getter +@Setter public class JwtKey { @Id @@ -49,202 +53,4 @@ public class JwtKey { @Column(name = "expires", nullable = false) private Instant expires; - /** - * 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 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 key ID. - * - * @return the key ID - */ - public String getKeyID() { - return keyID; - } - - /** - * Sets the key ID. - * - * @param keyID the new key ID - */ - public void setKeyID(String keyID) { - this.keyID = keyID; - } - - /** - * Gets the data. - * - * @return the data - */ - public String getData() { - return data; - } - - /** - * Sets the data. - * - * @param data the new data - */ - public void setData(String data) { - this.data = data; - } - - /** - * Gets the key type. - * - * @return the key type - */ - public String getKeyType() { - return keyType; - } - - /** - * Sets the key type. - * - * @param keyType the new key type - */ - public void setKeyType(String keyType) { - this.keyType = keyType; - } - - /** - * Gets the key parameter. - * - * @return the key parameter - */ - public String getKeyParameter() { - return keyParameter; - } - - /** - * Sets the key parameter. - * - * @param keyParameter the new key parameter - */ - public void setKeyParameter(String keyParameter) { - this.keyParameter = keyParameter; - } - - /** - * Gets the key use. - * - * @return the key use - */ - public String getKeyUse() { - return keyUse; - } - - /** - * Sets the key use. - * - * @param keyUse the new key use - */ - public void setKeyUse(String keyUse) { - this.keyUse = keyUse; - } - - /** - * Gets the jws algorithm. - * - * @return the jws algorithm - */ - public String getJwsAlgorithm() { - return jwsAlgorithm; - } - - /** - * Sets the jws algorithm. - * - * @param jwsAlgorithm the new jws algorithm - */ - public void setJwsAlgorithm(String jwsAlgorithm) { - this.jwsAlgorithm = jwsAlgorithm; - } - - /** - * Gets the lifetime. - * - * @return the lifetime - */ - public Long getLifetime() { - return lifetime; - } - - /** - * Sets the lifetime. - * - * @param lifetime the new lifetime - */ - public void setLifetime(Long lifetime) { - this.lifetime = lifetime; - } - - /** - * Gets the created. - * - * @return the created - */ - public Instant getCreated() { - return created; - } - - /** - * Sets the created. - * - * @param created the new created - */ - public void setCreated(Instant created) { - this.created = created; - } - - /** - * Gets the expires. - * - * @return the expires - */ - public Instant getExpires() { - return expires; - } - - /** - * Sets the expires. - * - * @param expires the new expires - */ - public void setExpires(Instant expires) { - this.expires = expires; - } - } diff --git a/minetest/pom.xml b/minetest/pom.xml index 266cfaf..f807ee5 100755 --- a/minetest/pom.xml +++ b/minetest/pom.xml @@ -25,5 +25,12 @@ ${querydsl.version} jakarta + + + + org.projectlombok + lombok + true + diff --git a/minetest/src/main/java/de/bstly/we/minetest/model/MinetestAccount.java b/minetest/src/main/java/de/bstly/we/minetest/model/MinetestAccount.java index 1fbbd41..0397c89 100644 --- a/minetest/src/main/java/de/bstly/we/minetest/model/MinetestAccount.java +++ b/minetest/src/main/java/de/bstly/we/minetest/model/MinetestAccount.java @@ -10,12 +10,16 @@ import jakarta.persistence.Lob; import jakarta.persistence.Table; import de.bstly.we.model.UserData; +import lombok.Getter; +import lombok.Setter; /** * The Class MinetestAccount. */ @Entity @Table(name = "minetest_accounts") +@Getter +@Setter public class MinetestAccount implements UserData { @Id @@ -27,58 +31,4 @@ public class MinetestAccount implements UserData { @Column(name = "skin", length = 100000) private String skin; - /** - * 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 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 skin. - * - * @return the skin - */ - public String getSkin() { - return skin; - } - - /** - * Sets the skin. - * - * @param skin the new skin - */ - public void setSkin(String skin) { - this.skin = skin; - } - } diff --git a/oidc/pom.xml b/oidc/pom.xml index f5663f5..99c4c4f 100755 --- a/oidc/pom.xml +++ b/oidc/pom.xml @@ -25,5 +25,12 @@ ${querydsl.version} jakarta + + + + org.projectlombok + lombok + true + diff --git a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcSessionManager.java b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcSessionManager.java index aab5b84..6094bb7 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcSessionManager.java +++ b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/OidcSessionManager.java @@ -143,7 +143,7 @@ public class OidcSessionManager { * @return the all by target */ public List getAllByTarget(Long clientId) { - return Lists.newArrayList(oidcSessionRepository.findAll(qOidcSession.client.eq(clientId))); + return Lists.newArrayList(oidcSessionRepository.findAll(qOidcSession.clientId.eq(clientId))); } /** @@ -165,7 +165,7 @@ public class OidcSessionManager { */ public List getAllByTargetAndSubject(Long clientId, Long subject) { return Lists.newArrayList( - oidcSessionRepository.findAll(qOidcSession.client.eq(clientId).and(qOidcSession.subject.eq(subject)))); + oidcSessionRepository.findAll(qOidcSession.clientId.eq(clientId).and(qOidcSession.subject.eq(subject)))); } /** diff --git a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/exception/InvalidAuthorizationRequestException.java b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/exception/InvalidAuthorizationRequestException.java index 6db12a2..3ec235e 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/exception/InvalidAuthorizationRequestException.java +++ b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/exception/InvalidAuthorizationRequestException.java @@ -6,10 +6,14 @@ package de.bstly.we.oidc.businesslogic.exception; import java.net.URI; import de.bstly.we.oidc.businesslogic.model.OidcAuthorizationErrorCode; +import lombok.Getter; +import lombok.Setter; /** * The Class InvalidAuthorizationRequestException. */ +@Getter +@Setter public class InvalidAuthorizationRequestException extends RuntimeException { /** * default serialVersionUID @@ -38,76 +42,4 @@ public class InvalidAuthorizationRequestException extends RuntimeException { this.state = state; } - /** - * Gets the redirect uri. - * - * @return the redirect uri - */ - public URI getRedirectUri() { - return redirectUri; - } - - /** - * Sets the redirect uri. - * - * @param redirectUri the new redirect uri - */ - public void setRedirectUri(URI redirectUri) { - this.redirectUri = redirectUri; - } - - /** - * Gets the error code. - * - * @return the error code - */ - public OidcAuthorizationErrorCode getErrorCode() { - return errorCode; - } - - /** - * Sets the error code. - * - * @param errorCode the new error code - */ - public void setErrorCode(OidcAuthorizationErrorCode errorCode) { - this.errorCode = errorCode; - } - - /** - * Gets the error description. - * - * @return the error description - */ - public String getErrorDescription() { - return errorDescription; - } - - /** - * Sets the error description. - * - * @param errorDescription the new error description - */ - public void setErrorDescription(String errorDescription) { - this.errorDescription = errorDescription; - } - - /** - * Gets the state. - * - * @return the state - */ - public String getState() { - return state; - } - - /** - * Sets the state. - * - * @param state the new state - */ - public void setState(String state) { - this.state = state; - } - } diff --git a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/exception/InvalidTokenRequestException.java b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/exception/InvalidTokenRequestException.java index d755218..edc1aeb 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/exception/InvalidTokenRequestException.java +++ b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/exception/InvalidTokenRequestException.java @@ -4,10 +4,14 @@ package de.bstly.we.oidc.businesslogic.exception; import de.bstly.we.oidc.businesslogic.model.OidcTokenErrorCode; +import lombok.Getter; +import lombok.Setter; /** * The Class InvalidTokenRequestException. */ +@Getter +@Setter public class InvalidTokenRequestException extends RuntimeException { /** @@ -30,40 +34,4 @@ public class InvalidTokenRequestException extends RuntimeException { this.errorDescription = errorDescription; } - /** - * Gets the error code. - * - * @return the error code - */ - public OidcTokenErrorCode getErrorCode() { - return errorCode; - } - - /** - * Sets the error code. - * - * @param errorCode the new error code - */ - public void setErrorCode(OidcTokenErrorCode errorCode) { - this.errorCode = errorCode; - } - - /** - * Gets the error description. - * - * @return the error description - */ - public String getErrorDescription() { - return errorDescription; - } - - /** - * Sets the error description. - * - * @param errorDescription the new error description - */ - public void setErrorDescription(String errorDescription) { - this.errorDescription = errorDescription; - } - } diff --git a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcAuthorizationCode.java b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcAuthorizationCode.java index c883db4..abda225 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcAuthorizationCode.java +++ b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcAuthorizationCode.java @@ -9,10 +9,14 @@ import java.time.temporal.ChronoUnit; import java.util.Set; import org.apache.commons.lang3.RandomStringUtils; +import lombok.Getter; +import lombok.Setter; /** * The Class OidcAuthorizationCode. */ +@Getter +@Setter public class OidcAuthorizationCode { public static final int CODE_LENGTH = 32; @@ -47,99 +51,5 @@ public class OidcAuthorizationCode { this.nonce = nonce; } - /** - * Gets the client id. - * - * @return the client id - */ - public String getClientId() { - return clientId; - } - - /** - * Gets the redirect uri. - * - * @return the redirect uri - */ - public URI getRedirectUri() { - return redirectUri; - } - - /** - * Gets the scopes. - * - * @return the scopes - */ - public Set getScopes() { - return scopes; - } - - /** - * Gets the code. - * - * @return the code - */ - public String getCode() { - return code; - } - - /** - * Gets the expiry. - * - * @return the expiry - */ - public Instant getExpiry() { - return expiry; - } - - /** - * Gets the user id. - * - * @return the user id - */ - public Long getUserId() { - return userId; - } - - /** - * Gets the nonce. - * - * @return the nonce - */ - public String getNonce() { - return nonce; - } - - /** - * Gets the spring session. - * - * @return the spring session - */ - public String getSpringSession() { - return springSession; - } - - /** - * Sets the spring session. - * - * @param springSession the new spring session - */ - public void setSpringSession(String springSession) { - this.springSession = springSession; - } - - /** - * @return the alias - */ - public String getAlias() { - return alias; - } - - /** - * @param alias the alias to set - */ - public void setAlias(String alias) { - this.alias = alias; - } } diff --git a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcAuthorizationRequest.java b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcAuthorizationRequest.java index 1d09731..ff0acec 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcAuthorizationRequest.java +++ b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcAuthorizationRequest.java @@ -5,9 +5,16 @@ package de.bstly.we.oidc.businesslogic.model; import java.net.URI; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + /** * The Class OidcAuthorizationRequest. */ +@Getter +@Setter +@AllArgsConstructor public class OidcAuthorizationRequest { private String code; @@ -25,258 +32,5 @@ public class OidcAuthorizationRequest { private String login_hint; private String acr_values; - /** - * Instantiates a new oidc authorization request. - * - * @param code the code - * @param client_id the client id - * @param response_type the response type - * @param redirect_uri the redirect uri - * @param scope the scope - * @param state the state - * @param nonce the nonce - * @param display the display - * @param prompt the prompt - * @param max_age the max age - * @param ui_locales the ui locales - * @param id_token_hint the id token hint - * @param login_hint the login hint - * @param acr_values the acr values - */ - public OidcAuthorizationRequest(String code, String client_id, String response_type, URI redirect_uri, String scope, - String state, String nonce, String display, String prompt, String max_age, String ui_locales, - String id_token_hint, String login_hint, String acr_values) { - super(); - this.code = code; - this.client_id = client_id; - this.response_type = response_type; - this.redirect_uri = redirect_uri; - this.scope = scope; - this.state = state; - this.nonce = nonce; - this.display = display; - this.prompt = prompt; - this.max_age = max_age; - this.ui_locales = ui_locales; - this.id_token_hint = id_token_hint; - this.login_hint = login_hint; - this.acr_values = acr_values; - } - - /** - * Gets the code. - * - * @return the code - */ - public String getCode() { - return code; - } - - /** - * Sets the code. - * - * @param code the new code - */ - public void setCode(String code) { - this.code = code; - } - - /** - * Gets the client id. - * - * @return the client id - */ - public String getClient_id() { - return client_id; - } - - /** - * Gets the response type. - * - * @return the response type - */ - public String getResponse_type() { - return response_type; - } - - /** - * Gets the redirect uri. - * - * @return the redirect uri - */ - public URI getRedirect_uri() { - return redirect_uri; - } - - /** - * Gets the scope. - * - * @return the scope - */ - public String getScope() { - return scope; - } - - /** - * Gets the state. - * - * @return the state - */ - public String getState() { - return state; - } - - /** - * Sets the state. - * - * @param state the new state - */ - public void setState(String state) { - this.state = state; - } - - /** - * Gets the display. - * - * @return the display - */ - public String getDisplay() { - return display; - } - - /** - * Sets the display. - * - * @param display the new display - */ - public void setDisplay(String display) { - this.display = display; - } - - /** - * Gets the nonce. - * - * @return the nonce - */ - public String getNonce() { - return nonce; - } - - /** - * Sets the nonce. - * - * @param nonce the new nonce - */ - public void setNonce(String nonce) { - this.nonce = nonce; - } - - /** - * Gets the prompt. - * - * @return the prompt - */ - public String getPrompt() { - return prompt; - } - - /** - * Sets the prompt. - * - * @param prompt the new prompt - */ - public void setPrompt(String prompt) { - this.prompt = prompt; - } - - /** - * Gets the max age. - * - * @return the max age - */ - public String getMax_age() { - return max_age; - } - - /** - * Sets the max age. - * - * @param max_age the new max age - */ - public void setMax_age(String max_age) { - this.max_age = max_age; - } - - /** - * Gets the ui locales. - * - * @return the ui locales - */ - public String getUi_locales() { - return ui_locales; - } - - /** - * Sets the ui locales. - * - * @param ui_locales the new ui locales - */ - public void setUi_locales(String ui_locales) { - this.ui_locales = ui_locales; - } - - /** - * Gets the id token hint. - * - * @return the id token hint - */ - public String getId_token_hint() { - return id_token_hint; - } - - /** - * Sets the id token hint. - * - * @param id_token_hint the new id token hint - */ - public void setId_token_hint(String id_token_hint) { - this.id_token_hint = id_token_hint; - } - - /** - * Gets the login hint. - * - * @return the login hint - */ - public String getLogin_hint() { - return login_hint; - } - - /** - * Sets the login hint. - * - * @param login_hint the new login hint - */ - public void setLogin_hint(String login_hint) { - this.login_hint = login_hint; - } - - /** - * Gets the acr values. - * - * @return the acr values - */ - public String getAcr_values() { - return acr_values; - } - - /** - * Sets the acr values. - * - * @param acr_values the new acr values - */ - public void setAcr_values(String acr_values) { - this.acr_values = acr_values; - } } diff --git a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenRequest.java b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenRequest.java index 3c969bc..7cab5f5 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenRequest.java +++ b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenRequest.java @@ -5,9 +5,16 @@ package de.bstly.we.oidc.businesslogic.model; import java.net.URI; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.Setter; + /** * The Class OidcTokenRequest. */ +@Getter +@Setter +@AllArgsConstructor public class OidcTokenRequest { private final String code; @@ -18,117 +25,5 @@ public class OidcTokenRequest { private final URI redirect_uri; private final String scope; - /** - * Instantiates a new oidc token request. - * - * @param code the code - * @param grant_type the grant type - * @param client_id the client id - * @param client_secret the client secret - * @param refresh_token the refresh token - * @param redirect_uri the redirect uri - * @param scope the scope - */ - public OidcTokenRequest(String code, OidcAuthorizationGrantType grant_type, String client_id, String client_secret, - String refresh_token, URI redirect_uri, String scope) { - super(); - this.code = code; - this.grant_type = grant_type; - this.client_id = client_id; - this.client_secret = client_secret; - this.refresh_token = refresh_token; - this.redirect_uri = redirect_uri; - this.scope = scope; - } - - /** - * Gets the client id. - * - * @return the client id - */ - public String getClient_id() { - return client_id; - } - - /** - * Sets the client id. - * - * @param client_id the new client id - */ - public void setClient_id(String client_id) { - this.client_id = client_id; - } - - /** - * Gets the client secret. - * - * @return the client secret - */ - public String getClient_secret() { - return client_secret; - } - - /** - * Sets the client secret. - * - * @param client_secret the new client secret - */ - public void setClient_secret(String client_secret) { - this.client_secret = client_secret; - } - - /** - * Gets the refresh token. - * - * @return the refresh token - */ - public String getRefresh_token() { - return refresh_token; - } - - /** - * Sets the refresh token. - * - * @param refresh_token the new refresh token - */ - public void setRefresh_token(String refresh_token) { - this.refresh_token = refresh_token; - } - - /** - * Gets the code. - * - * @return the code - */ - public String getCode() { - return code; - } - - /** - * Gets the grant type. - * - * @return the grant type - */ - public OidcAuthorizationGrantType getGrant_type() { - return grant_type; - } - - /** - * Gets the redirect uri. - * - * @return the redirect uri - */ - public URI getRedirect_uri() { - return redirect_uri; - } - - /** - * Gets the scope. - * - * @return the scope - */ - public String getScope() { - return scope; - } } diff --git a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenResponse.java b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenResponse.java index ecbf31f..5c95a99 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenResponse.java +++ b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenResponse.java @@ -4,11 +4,15 @@ package de.bstly.we.oidc.businesslogic.model; import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Getter; +import lombok.Setter; /** * The Class OidcTokenResponse. */ @JsonInclude(JsonInclude.Include.NON_EMPTY) +@Getter +@Setter public class OidcTokenResponse { private String access_token; @@ -17,94 +21,4 @@ public class OidcTokenResponse { private long expires_in; private String id_token; - /** - * Gets the access token. - * - * @return the access token - */ - public String getAccess_token() { - return access_token; - } - - /** - * Sets the access token. - * - * @param access_token the new access token - */ - public void setAccess_token(String access_token) { - this.access_token = access_token; - } - - /** - * Gets the token type. - * - * @return the token type - */ - public String getToken_type() { - return token_type; - } - - /** - * Sets the token type. - * - * @param token_type the new token type - */ - public void setToken_type(String token_type) { - this.token_type = token_type; - } - - /** - * Gets the refresh token. - * - * @return the refresh token - */ - public String getRefresh_token() { - return refresh_token; - } - - /** - * Sets the refresh token. - * - * @param refresh_token the new refresh token - */ - public void setRefresh_token(String refresh_token) { - this.refresh_token = refresh_token; - } - - /** - * Gets the expires in. - * - * @return the expires in - */ - public long getExpires_in() { - return expires_in; - } - - /** - * Sets the expires in. - * - * @param expires_in the new expires in - */ - public void setExpires_in(long expires_in) { - this.expires_in = expires_in; - } - - /** - * Gets the id token. - * - * @return the id token - */ - public String getId_token() { - return id_token; - } - - /** - * Sets the id token. - * - * @param id_token the new id token - */ - public void setId_token(String id_token) { - this.id_token = id_token; - } - } diff --git a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenRevokeRequest.java b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenRevokeRequest.java index 3867ada..28c61af 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenRevokeRequest.java +++ b/oidc/src/main/java/de/bstly/we/oidc/businesslogic/model/OidcTokenRevokeRequest.java @@ -3,48 +3,17 @@ */ package de.bstly.we.oidc.businesslogic.model; +import lombok.Getter; +import lombok.Setter; + /** * The Class OidcTokenRevokeRequest. */ +@Getter +@Setter public class OidcTokenRevokeRequest { private String token; private String token_type_hint; - /** - * Gets the token. - * - * @return the token - */ - public String getToken() { - return token; - } - - /** - * Sets the token. - * - * @param token the new token - */ - public void setToken(String token) { - this.token = token; - } - - /** - * Gets the token type hint. - * - * @return the token type hint - */ - public String getToken_type_hint() { - return token_type_hint; - } - - /** - * Sets the token type hint. - * - * @param token_type_hint the new token type hint - */ - public void setToken_type_hint(String token_type_hint) { - this.token_type_hint = token_type_hint; - } - } diff --git a/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientInfo.java b/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientInfo.java index 8164094..ceb825f 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientInfo.java +++ b/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientInfo.java @@ -8,10 +8,14 @@ import java.util.Map; import java.util.Set; import de.bstly.we.oidc.model.OidcSession; +import lombok.Getter; +import lombok.Setter; /** * The Class OidcClientInfo. */ +@Getter +@Setter public class OidcClientInfo { private String clientId; @@ -28,239 +32,4 @@ public class OidcClientInfo { private Map claims; private List sessions; - /** - * Gets the client id. - * - * @return the client id - */ - public String getClientId() { - return clientId; - } - - /** - * Sets the client id. - * - * @param clientId the new client id - */ - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * 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 login url. - * - * @return the login url - */ - public String getLoginUrl() { - return loginUrl; - } - - /** - * Sets the login url. - * - * @param loginUrl the new login url - */ - public void setLoginUrl(String loginUrl) { - this.loginUrl = loginUrl; - } - - /** - * Gets the frontchannel logout uri. - * - * @return the frontchannel logout uri - */ - public String getFrontchannelLogoutUri() { - return frontchannelLogoutUri; - } - - /** - * Sets the frontchannel logout uri. - * - * @param frontchannelLogoutUri the new frontchannel logout uri - */ - public void setFrontchannelLogoutUri(String frontchannelLogoutUri) { - this.frontchannelLogoutUri = frontchannelLogoutUri; - } - - /** - * Checks if is frontchannel logout session required. - * - * @return true, if is frontchannel logout session required - */ - public boolean isFrontchannelLogoutSessionRequired() { - return frontchannelLogoutSessionRequired; - } - - /** - * Sets the frontchannel logout session required. - * - * @param frontchannelLogoutSessionRequired the new frontchannel logout session - * required - */ - public void setFrontchannelLogoutSessionRequired(boolean frontchannelLogoutSessionRequired) { - this.frontchannelLogoutSessionRequired = frontchannelLogoutSessionRequired; - } - - /** - * Checks if is backchannel logout. - * - * @return true, if is backchannel logout - */ - public boolean isBackchannelLogout() { - return backchannelLogout; - } - - /** - * Sets the backchannel logout. - * - * @param backchannelLogout the new backchannel logout - */ - public void setBackchannelLogout(boolean backchannelLogout) { - this.backchannelLogout = backchannelLogout; - } - - /** - * Checks if is authorize. - * - * @return true, if is authorize - */ - public boolean isAuthorize() { - return authorize; - } - - /** - * Sets the authorize. - * - * @param authorize the new authorize - */ - public void setAuthorize(boolean authorize) { - this.authorize = authorize; - } - - /** - * Gets the scopes. - * - * @return the scopes - */ - public Set getScopes() { - return scopes; - } - - /** - * Sets the scopes. - * - * @param scopes the new scopes - */ - public void setScopes(Set scopes) { - this.scopes = scopes; - } - - /** - * Gets the claim mapping. - * - * @return the claim mapping - */ - public Map> getClaimMapping() { - return claimMapping; - } - - /** - * Sets the claim mapping. - * - * @param claimMapping the claim mapping - */ - public void setClaimMapping(Map> claimMapping) { - this.claimMapping = claimMapping; - } - - /** - * Gets the authorized scopes. - * - * @return the authorized scopes - */ - public Set getAuthorizedScopes() { - return authorizedScopes; - } - - /** - * Sets the authorized scopes. - * - * @param authorizedScopes the new authorized scopes - */ - public void setAuthorizedScopes(Set authorizedScopes) { - this.authorizedScopes = authorizedScopes; - } - - /** - * Gets the claims. - * - * @return the claims - */ - public Map getClaims() { - return claims; - } - - /** - * Sets the claims. - * - * @param claims the claims - */ - public void setClaims(Map claims) { - this.claims = claims; - } - - /** - * Gets the sessions. - * - * @return the sessions - */ - public List getSessions() { - return sessions; - } - - /** - * Sets the sessions. - * - * @param sessions the new sessions - */ - public void setSessions(List sessions) { - this.sessions = sessions; - } - } diff --git a/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientModel.java b/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientModel.java index f1a1788..6fa3e0b 100755 --- a/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientModel.java +++ b/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcClientModel.java @@ -7,10 +7,14 @@ import java.util.Set; import de.bstly.we.oidc.businesslogic.model.OidcAuthorizationGrantType; import de.bstly.we.oidc.businesslogic.model.OidcClientAuthenticationMethod; +import lombok.Getter; +import lombok.Setter; /** * The Class OidcClientModel. */ +@Getter +@Setter public class OidcClientModel { private String name; @@ -21,130 +25,4 @@ public class OidcClientModel { private String loginUrl; private boolean alwaysPermitted; - /** - * 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 registered redirect uris. - * - * @return the registered redirect uris - */ - public Set getRegisteredRedirectUris() { - return registeredRedirectUris; - } - - /** - * Sets the registered redirect uris. - * - * @param registeredRedirectUris the new registered redirect uris - */ - public void setRegisteredRedirectUris(Set registeredRedirectUris) { - this.registeredRedirectUris = registeredRedirectUris; - } - - /** - * Gets the client authentication methods. - * - * @return the client authentication methods - */ - public Set getClientAuthenticationMethods() { - return clientAuthenticationMethods; - } - - /** - * Sets the client authentication methods. - * - * @param clientAuthenticationMethods the new client authentication methods - */ - public void setClientAuthenticationMethods(Set clientAuthenticationMethods) { - this.clientAuthenticationMethods = clientAuthenticationMethods; - } - - /** - * Gets the authorization grant types. - * - * @return the authorization grant types - */ - public Set getAuthorizationGrantTypes() { - return authorizationGrantTypes; - } - - /** - * Sets the authorization grant types. - * - * @param authorizationGrantTypes the new authorization grant types - */ - public void setAuthorizationGrantTypes(Set authorizationGrantTypes) { - this.authorizationGrantTypes = authorizationGrantTypes; - } - - /** - * Gets the scopes. - * - * @return the scopes - */ - public Set getScopes() { - return scopes; - } - - /** - * Sets the scopes. - * - * @param scopes the new scopes - */ - public void setScopes(Set scopes) { - this.scopes = scopes; - } - - /** - * Gets the login url. - * - * @return the login url - */ - public String getLoginUrl() { - return loginUrl; - } - - /** - * Sets the login url. - * - * @param loginUrl the new login url - */ - public void setLoginUrl(String loginUrl) { - this.loginUrl = loginUrl; - } - - /** - * Checks if is always permitted. - * - * @return true, if is always permitted - */ - public boolean isAlwaysPermitted() { - return alwaysPermitted; - } - - /** - * Sets the always permitted. - * - * @param alwaysPermitted the new always permitted - */ - public void setAlwaysPermitted(boolean alwaysPermitted) { - this.alwaysPermitted = alwaysPermitted; - } - } diff --git a/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcConfiguration.java b/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcConfiguration.java index 819995a..43e90d6 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcConfiguration.java +++ b/oidc/src/main/java/de/bstly/we/oidc/controller/model/OidcConfiguration.java @@ -5,10 +5,14 @@ package de.bstly.we.oidc.controller.model; import java.net.URI; import java.util.Set; +import lombok.Getter; +import lombok.Setter; /** * The Class OidcConfiguration. */ +@Getter +@Setter public class OidcConfiguration { private String issuer; @@ -23,193 +27,4 @@ public class OidcConfiguration { private Set token_endpoint_auth_methods_supported; private Set id_token_signing_alg_values_supported; - /** - * Gets the issuer. - * - * @return the issuer - */ - public String getIssuer() { - return issuer; - } - - /** - * Sets the issuer. - * - * @param issuer the new issuer - */ - public void setIssuer(String issuer) { - this.issuer = issuer; - } - - /** - * Gets the authorization endpoint. - * - * @return the authorization endpoint - */ - public URI getAuthorization_endpoint() { - return authorization_endpoint; - } - - /** - * Sets the authorization endpoint. - * - * @param authorization_endpoint the new authorization endpoint - */ - public void setAuthorization_endpoint(URI authorization_endpoint) { - this.authorization_endpoint = authorization_endpoint; - } - - /** - * Gets the token endpoint. - * - * @return the token endpoint - */ - public URI getToken_endpoint() { - return token_endpoint; - } - - /** - * Sets the token endpoint. - * - * @param token_endpoint the new token endpoint - */ - public void setToken_endpoint(URI token_endpoint) { - this.token_endpoint = token_endpoint; - } - - /** - * Gets the userinfo endpoint. - * - * @return the userinfo endpoint - */ - public URI getUserinfo_endpoint() { - return userinfo_endpoint; - } - - /** - * Sets the userinfo endpoint. - * - * @param userinfo_endpoint the new userinfo endpoint - */ - public void setUserinfo_endpoint(URI userinfo_endpoint) { - this.userinfo_endpoint = userinfo_endpoint; - } - - /** - * Gets the jwks uri. - * - * @return the jwks uri - */ - public URI getJwks_uri() { - return jwks_uri; - } - - /** - * Sets the jwks uri. - * - * @param jwks_uri the new jwks uri - */ - public void setJwks_uri(URI jwks_uri) { - this.jwks_uri = jwks_uri; - } - - /** - * Gets the scopes supported. - * - * @return the scopes supported - */ - public Set getScopes_supported() { - return scopes_supported; - } - - /** - * Sets the scopes supported. - * - * @param scopes_supported the new scopes supported - */ - public void setScopes_supported(Set scopes_supported) { - this.scopes_supported = scopes_supported; - } - - /** - * Gets the response types supported. - * - * @return the response types supported - */ - public Set getResponse_types_supported() { - return response_types_supported; - } - - /** - * Sets the response types supported. - * - * @param response_types_supported the new response types supported - */ - public void setResponse_types_supported(Set response_types_supported) { - this.response_types_supported = response_types_supported; - } - - /** - * Gets the subject types supported. - * - * @return the subject types supported - */ - public Set getSubject_types_supported() { - return subject_types_supported; - } - - /** - * Sets the subject types supported. - * - * @param subject_types_supported the new subject types supported - */ - public void setSubject_types_supported(Set subject_types_supported) { - this.subject_types_supported = subject_types_supported; - } - - /** - * Gets the grant types supported. - * - * @return the grant types supported - */ - public Set getGrant_types_supported() { - return grant_types_supported; - } - - /** - * Sets the grant types supported. - * - * @param grant_types_supported the new grant types supported - */ - public void setGrant_types_supported(Set grant_types_supported) { - this.grant_types_supported = grant_types_supported; - } - - /** - * Gets the token endpoint auth methods supported. - * - * @return the token endpoint auth methods supported - */ - public Set getToken_endpoint_auth_methods_supported() { - return token_endpoint_auth_methods_supported; - } - - /** - * Sets the token endpoint auth methods supported. - * - * @param token_endpoint_auth_methods_supported the new token endpoint auth - * methods supported - */ - public void setToken_endpoint_auth_methods_supported(Set token_endpoint_auth_methods_supported) { - this.token_endpoint_auth_methods_supported = token_endpoint_auth_methods_supported; - } - - public Set getId_token_signing_alg_values_supported() { - return id_token_signing_alg_values_supported; - } - - public void setId_token_signing_alg_values_supported(Set id_token_signing_alg_values_supported) { - this.id_token_signing_alg_values_supported = id_token_signing_alg_values_supported; - } - } diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorization.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorization.java index be47235..fabd696 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorization.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcAuthorization.java @@ -14,12 +14,16 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class OidcAuthorization. */ @Entity @Table(name = "oidc_authorizations") +@Getter +@Setter public class OidcAuthorization { @Id @@ -34,43 +38,7 @@ public class OidcAuthorization { @CollectionTable(name = "oidc_authorizations_scopes") private Set scopes; - /** - * Gets the client. - * - * @return the client - */ - public Long getClient() { - return client; - } - - /** - * Sets the client. - * - * @param client the new client - */ - public void setClient(Long client) { - this.client = client; - } - - /** - * Gets the subject. - * - * @return the subject - */ - public Long getSubject() { - return subject; - } - - /** - * Sets the subject. - * - * @param subject the new subject - */ - public void setSubject(Long subject) { - this.subject = subject; - } - - /** +/** * Gets the scopes. * * @return the scopes @@ -78,14 +46,4 @@ public class OidcAuthorization { public Set getScopes() { return scopes; } - - /** - * Sets the scopes. - * - * @param scopes the new scopes - */ - public void setScopes(Set scopes) { - this.scopes = scopes; - } - } diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcClient.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcClient.java index f9d8eae..0b4c25e 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcClient.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcClient.java @@ -18,12 +18,16 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class OidcClient. */ @Entity @Table(name = "oidc_clients") +@Getter +@Setter public class OidcClient { @Id @@ -75,354 +79,4 @@ public class OidcClient { @Column(name = "category") private String category; - /** - * 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 client name. - * - * @return the client name - */ - public String getClientName() { - return clientName; - } - - /** - * Sets the client name. - * - * @param clientName the new client name - */ - public void setClientName(String clientName) { - this.clientName = clientName; - } - - /** - * Gets the client id. - * - * @return the client id - */ - public String getClientId() { - return clientId; - } - - /** - * Sets the client id. - * - * @param clientId the new client id - */ - public void setClientId(String clientId) { - this.clientId = clientId; - } - - /** - * Gets the client secret. - * - * @return the client secret - */ - public String getClientSecret() { - return clientSecret; - } - - /** - * Sets the client secret. - * - * @param clientSecret the new client secret - */ - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - /** - * Gets the client authentication methods. - * - * @return the client authentication methods - */ - public Set getClientAuthenticationMethods() { - return clientAuthenticationMethods; - } - - /** - * Sets the client authentication methods. - * - * @param clientAuthenticationMethods the new client authentication methods - */ - public void setClientAuthenticationMethods(Set clientAuthenticationMethods) { - this.clientAuthenticationMethods = clientAuthenticationMethods; - } - - /** - * Gets the authorization grant types. - * - * @return the authorization grant types - */ - public Set getAuthorizationGrantTypes() { - return authorizationGrantTypes; - } - - /** - * Sets the authorization grant types. - * - * @param authorizationGrantTypes the new authorization grant types - */ - public void setAuthorizationGrantTypes(Set authorizationGrantTypes) { - this.authorizationGrantTypes = authorizationGrantTypes; - } - - /** - * Gets the redirect uris. - * - * @return the redirect uris - */ - public Set getRedirectUris() { - return redirectUris; - } - - /** - * Sets the redirect uris. - * - * @param redirectUris the new redirect uris - */ - public void setRedirectUris(Set redirectUris) { - this.redirectUris = redirectUris; - } - - /** - * Gets the scopes. - * - * @return the scopes - */ - public Set getScopes() { - return scopes; - } - - /** - * Sets the scopes. - * - * @param scopes the new scopes - */ - public void setScopes(Set scopes) { - this.scopes = scopes; - } - - /** - * Gets the token lifetime. - * - * @return the token lifetime - */ - public Long getTokenLifetime() { - return tokenLifetime; - } - - /** - * Sets the token lifetime. - * - * @param tokenLifetime the new token lifetime - */ - public void setTokenLifetime(Long tokenLifetime) { - this.tokenLifetime = tokenLifetime; - } - - /** - * Gets the login url. - * - * @return the login url - */ - public String getLoginUrl() { - return loginUrl; - } - - /** - * Sets the login url. - * - * @param loginUrl the new login url - */ - public void setLoginUrl(String loginUrl) { - this.loginUrl = loginUrl; - } - - /** - * Gets the frontchannel logout uri. - * - * @return the frontchannel logout uri - */ - public String getFrontchannelLogoutUri() { - return frontchannelLogoutUri; - } - - /** - * Sets the frontchannel logout uri. - * - * @param frontchannelLogoutUri the new frontchannel logout uri - */ - public void setFrontchannelLogoutUri(String frontchannelLogoutUri) { - this.frontchannelLogoutUri = frontchannelLogoutUri; - } - - /** - * Checks if is frontchannel logout session required. - * - * @return true, if is frontchannel logout session required - */ - public boolean isFrontchannelLogoutSessionRequired() { - return frontchannelLogoutSessionRequired; - } - - /** - * Sets the frontchannel logout session required. - * - * @param frontchannelLogoutSessionRequired the new frontchannel logout session - * required - */ - public void setFrontchannelLogoutSessionRequired(boolean frontchannelLogoutSessionRequired) { - this.frontchannelLogoutSessionRequired = frontchannelLogoutSessionRequired; - } - - /** - * Gets the backchannel logout uri. - * - * @return the backchannel logout uri - */ - public String getBackchannelLogoutUri() { - return backchannelLogoutUri; - } - - /** - * Sets the backchannel logout uri. - * - * @param backchannelLogoutUri the new backchannel logout uri - */ - public void setBackchannelLogoutUri(String backchannelLogoutUri) { - this.backchannelLogoutUri = backchannelLogoutUri; - } - - /** - * Checks if is backchannel logout session required. - * - * @return true, if is backchannel logout session required - */ - public boolean isBackchannelLogoutSessionRequired() { - return backchannelLogoutSessionRequired; - } - - /** - * Sets the backchannel logout session required. - * - * @param backchannelLogoutSessionRequired the new backchannel logout session - * required - */ - public void setBackchannelLogoutSessionRequired(boolean backchannelLogoutSessionRequired) { - this.backchannelLogoutSessionRequired = backchannelLogoutSessionRequired; - } - - /** - * Checks if is authorize. - * - * @return true, if is authorize - */ - public boolean isAuthorize() { - return authorize; - } - - /** - * Sets the authorize. - * - * @param authorize the new authorize - */ - public void setAuthorize(boolean authorize) { - this.authorize = authorize; - } - - /** - * @return the aliasAllowed - */ - public boolean isAliasAllowed() { - return aliasAllowed; - } - - /** - * @param aliasAllowed the aliasAllowed to set - */ - public void setAliasAllowed(boolean aliasAllowed) { - this.aliasAllowed = aliasAllowed; - } - - /** - * @return the aliasQuota - */ - public boolean isAliasQuota() { - return aliasQuota; - } - - /** - * @param aliasQuota the aliasQuota to set - */ - public void setAliasQuota(boolean aliasQuota) { - this.aliasQuota = aliasQuota; - } - - /** - * @return the aliasSubject - */ - public boolean isAliasSubject() { - return aliasSubject; - } - - /** - * @param aliasSubject the aliasSubject to set - */ - public void setAliasSubject(boolean aliasSubject) { - this.aliasSubject = aliasSubject; - } - - /** - * Checks if is always permitted. - * - * @return true, if is always permitted - */ - public boolean isAlwaysPermitted() { - return alwaysPermitted; - } - - /** - * Sets the always permitted. - * - * @param alwaysPermitted the new always permitted - */ - public void setAlwaysPermitted(boolean alwaysPermitted) { - this.alwaysPermitted = alwaysPermitted; - } - - /** - * Gets the category. - * - * @return the category - */ - public String getCategory() { - return category; - } - - /** - * Sets the category. - * - * @param category the new category - */ - public void setCategory(String category) { - this.category = category; - } - } diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcSession.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcSession.java index edd7ab2..50bd94c 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcSession.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcSession.java @@ -9,12 +9,16 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class OidcSession. */ @Entity @Table(name = "oidc_sessions") +@Getter +@Setter public class OidcSession { @Id @@ -22,7 +26,7 @@ public class OidcSession { @Column(name = "id") private Long id; @Column(name = "client_id") - private Long client; + private Long clientId; @Column(name = "subject") private Long subject; @Column(name = "sid") @@ -32,112 +36,4 @@ public class OidcSession { @Column(name = "spring_session_id") private String springSession; - /** - * 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 client id. - * - * @return the client id - */ - public Long getClientId() { - return client; - } - - /** - * Sets the client id. - * - * @param clientId the new client id - */ - public void setClientId(Long clientId) { - this.client = clientId; - } - - /** - * Gets the subject. - * - * @return the subject - */ - public Long getSubject() { - return subject; - } - - /** - * Sets the subject. - * - * @param subject the new subject - */ - public void setSubject(Long subject) { - this.subject = subject; - } - - /** - * Gets the sid. - * - * @return the sid - */ - public String getSid() { - return sid; - } - - /** - * Sets the sid. - * - * @param sid the new sid - */ - public void setSid(String sid) { - this.sid = sid; - } - - /** - * Gets the id token. - * - * @return the id token - */ - public String getIdToken() { - return idToken; - } - - /** - * Sets the id token. - * - * @param idToken the new id token - */ - public void setIdToken(String idToken) { - this.idToken = idToken; - } - - /** - * Gets the spring session. - * - * @return the spring session - */ - public String getSpringSession() { - return springSession; - } - - /** - * Sets the spring session. - * - * @param springSession the new spring session - */ - public void setSpringSession(String springSession) { - this.springSession = springSession; - } - } diff --git a/oidc/src/main/java/de/bstly/we/oidc/model/OidcToken.java b/oidc/src/main/java/de/bstly/we/oidc/model/OidcToken.java index 8b91fad..a42b20b 100644 --- a/oidc/src/main/java/de/bstly/we/oidc/model/OidcToken.java +++ b/oidc/src/main/java/de/bstly/we/oidc/model/OidcToken.java @@ -16,12 +16,16 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class OidcToken. */ @Entity @Table(name = "oidc_tokens") +@Getter +@Setter public class OidcToken { @Id @@ -48,180 +52,4 @@ public class OidcToken { @ElementCollection(fetch = FetchType.EAGER) private Set scopes; - /** - * 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 created. - * - * @return the created - */ - public Instant getCreated() { - return created; - } - - /** - * Sets the created. - * - * @param created the new created - */ - public void setCreated(Instant created) { - this.created = created; - } - - /** - * Gets the user id. - * - * @return the user id - */ - public Long getUserId() { - return userId; - } - - /** - * Sets the user id. - * - * @param userId the new user id - */ - public void setUserId(Long userId) { - this.userId = userId; - } - - /** - * @return the alias - */ - public String getAlias() { - return alias; - } - - /** - * @param alias the alias to set - */ - public void setAlias(String alias) { - this.alias = alias; - } - - /** - * Gets the client. - * - * @return the client - */ - public Long getClient() { - return client; - } - - /** - * Sets the client. - * - * @param client the new client - */ - public void setClient(Long client) { - this.client = client; - } - - /** - * Gets the access token. - * - * @return the access token - */ - public String getAccessToken() { - return accessToken; - } - - /** - * Sets the access token. - * - * @param accessToken the new access token - */ - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - /** - * Gets the refresh token. - * - * @return the refresh token - */ - public String getRefreshToken() { - return refreshToken; - } - - /** - * Sets the refresh token. - * - * @param refreshToken the new refresh token - */ - public void setRefreshToken(String refreshToken) { - this.refreshToken = refreshToken; - } - - /** - * Gets the expires in. - * - * @return the expires in - */ - public Long getExpiresIn() { - return expiresIn; - } - - /** - * Sets the expires in. - * - * @param expiresIn the new expires in - */ - public void setExpiresIn(Long expiresIn) { - this.expiresIn = expiresIn; - } - - /** - * Gets the id token. - * - * @return the id token - */ - public String getIdToken() { - return idToken; - } - - /** - * Sets the id token. - * - * @param idToken the new id token - */ - public void setIdToken(String idToken) { - this.idToken = idToken; - } - - /** - * Gets the scopes. - * - * @return the scopes - */ - public Set getScopes() { - return scopes; - } - - /** - * Sets the scopes. - * - * @param scopes the new scopes - */ - public void setScopes(Set scopes) { - this.scopes = scopes; - } - } diff --git a/partey/pom.xml b/partey/pom.xml index dc16a6f..e920778 100755 --- a/partey/pom.xml +++ b/partey/pom.xml @@ -35,5 +35,12 @@ ${querydsl.version} jakarta + + + + org.projectlombok + lombok + true + diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/model/CharacterTexture.java b/partey/src/main/java/de/bstly/we/partey/api/controller/model/CharacterTexture.java index 2130d6e..655fab0 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/model/CharacterTexture.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/model/CharacterTexture.java @@ -3,67 +3,18 @@ */ package de.bstly.we.partey.api.controller.model; +import lombok.Getter; +import lombok.Setter; + /** * The Class CharacterTexture. */ +@Getter +@Setter public class CharacterTexture { private String id; private String url; private String layer; - /** - * Gets the id. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Sets the id. - * - * @param id the new id - */ - public void setId(String id) { - this.id = id; - } - - /** - * 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 layer. - * - * @return the layer - */ - public String getLayer() { - return layer; - } - - /** - * Sets the layer. - * - * @param layer the new layer - */ - public void setLayer(String layer) { - this.layer = layer; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/model/MapDetailsData.java b/partey/src/main/java/de/bstly/we/partey/api/controller/model/MapDetailsData.java index ab26a0e..d0cbfc8 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/model/MapDetailsData.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/model/MapDetailsData.java @@ -6,10 +6,14 @@ package de.bstly.we.partey.api.controller.model; import java.util.List; import com.google.common.collect.Lists; +import lombok.Getter; +import lombok.Setter; /** * The Class MapDetailsData. */ +@Getter +@Setter public class MapDetailsData { private String mapUrl = ""; @@ -27,200 +31,4 @@ public class MapDetailsData { private boolean showPoweredBy = false; private Object thirdParty; - /** - * @return the mapUrl - */ - public String getMapUrl() { - return mapUrl; - } - - /** - * @param mapUrl the mapUrl to set - */ - public void setMapUrl(String mapUrl) { - this.mapUrl = mapUrl; - } - - /** - * @return the authenticationMandatory - */ - public boolean isAuthenticationMandatory() { - return authenticationMandatory; - } - - /** - * @param authenticationMandatory the authenticationMandatory to set - */ - public void setAuthenticationMandatory(boolean authenticationMandatory) { - this.authenticationMandatory = authenticationMandatory; - } - - /** - * @return the group - */ - public String getGroup() { - return group; - } - - /** - * @param group the group to set - */ - public void setGroup(String group) { - this.group = group; - } - - /** - * @return the mucRooms - */ - public List getMucRooms() { - return mucRooms; - } - - /** - * @param mucRooms the mucRooms to set - */ - public void setMucRooms(List mucRooms) { - this.mucRooms = mucRooms; - } - - /** - * @return the contactPage - */ - public String getContactPage() { - return contactPage; - } - - /** - * @param contactPage the contactPage to set - */ - public void setContactPage(String contactPage) { - this.contactPage = contactPage; - } - - /** - * @return the iframeAuthentication - */ - public String getIframeAuthentication() { - return iframeAuthentication; - } - - /** - * @param iframeAuthentication the iframeAuthentication to set - */ - public void setIframeAuthentication(String iframeAuthentication) { - this.iframeAuthentication = iframeAuthentication; - } - - /** - * @return the expireOn - */ - public String getExpireOn() { - return expireOn; - } - - /** - * @param expireOn the expireOn to set - */ - public void setExpireOn(String expireOn) { - this.expireOn = expireOn; - } - - /** - * @return the canReport - */ - public boolean isCanReport() { - return canReport; - } - - /** - * @param canReport the canReport to set - */ - public void setCanReport(boolean canReport) { - this.canReport = canReport; - } - - /** - * @return the loadingCowebsiteLogo - */ - public String getLoadingCowebsiteLogo() { - return loadingCowebsiteLogo; - } - - /** - * @param loadingCowebsiteLogo the loadingCowebsiteLogo to set - */ - public void setLoadingCowebsiteLogo(String loadingCowebsiteLogo) { - this.loadingCowebsiteLogo = loadingCowebsiteLogo; - } - - /** - * @return the miniLogo - */ - public String getMiniLogo() { - return miniLogo; - } - - /** - * @param miniLogo the miniLogo to set - */ - public void setMiniLogo(String miniLogo) { - this.miniLogo = miniLogo; - } - - /** - * @return the loadingLogo - */ - public String getLoadingLogo() { - return loadingLogo; - } - - /** - * @param loadingLogo the loadingLogo to set - */ - public void setLoadingLogo(String loadingLogo) { - this.loadingLogo = loadingLogo; - } - - /** - * @return the loginSceneLogo - */ - public String getLoginSceneLogo() { - return loginSceneLogo; - } - - /** - * @param loginSceneLogo the loginSceneLogo to set - */ - public void setLoginSceneLogo(String loginSceneLogo) { - this.loginSceneLogo = loginSceneLogo; - } - - /** - * @return the showPoweredBy - */ - public boolean isShowPoweredBy() { - return showPoweredBy; - } - - /** - * @param showPoweredBy the showPoweredBy to set - */ - public void setShowPoweredBy(boolean showPoweredBy) { - this.showPoweredBy = showPoweredBy; - } - - /** - * @return the thirdParty - */ - public Object getThirdParty() { - return thirdParty; - } - - /** - * @param thirdParty the thirdParty to set - */ - public void setThirdParty(Object thirdParty) { - this.thirdParty = thirdParty; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/model/MemberData.java b/partey/src/main/java/de/bstly/we/partey/api/controller/model/MemberData.java index 6faaa2b..3cd292f 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/model/MemberData.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/model/MemberData.java @@ -6,10 +6,14 @@ package de.bstly.we.partey.api.controller.model; import java.util.List; import com.beust.jcommander.internal.Lists; +import lombok.Getter; +import lombok.Setter; /** * The Class MemberData. */ +@Getter +@Setter public class MemberData { private String email; @@ -24,190 +28,4 @@ public class MemberData { private String jabberPassword; private List mucRooms = Lists.newArrayList(); - /** - * 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; - } - - /** - * Gets the user uuid. - * - * @return the user uuid - */ - public String getUserUuid() { - return userUuid; - } - - /** - * Sets the user uuid. - * - * @param userUuid the new user uuid - */ - public void setUserUuid(String userUuid) { - this.userUuid = userUuid; - } - - /** - * Gets the tags. - * - * @return the tags - */ - public List getTags() { - return tags; - } - - /** - * Sets the tags. - * - * @param tags the new tags - */ - public void setTags(List tags) { - this.tags = tags; - } - - /** - * Gets the visit card url. - * - * @return the visit card url - */ - public String getVisitCardUrl() { - return visitCardUrl; - } - - /** - * Sets the visit card url. - * - * @param visitCardUrl the new visit card url - */ - public void setVisitCardUrl(String visitCardUrl) { - this.visitCardUrl = visitCardUrl; - } - - /** - * Gets the textures. - * - * @return the textures - */ - public List getTextures() { - return textures; - } - - /** - * Sets the textures. - * - * @param textures the new textures - */ - public void setTextures(List textures) { - this.textures = textures; - } - - /** - * Gets the messages. - * - * @return the messages - */ - public List getMessages() { - return messages; - } - - /** - * Sets the messages. - * - * @param messages the new messages - */ - public void setMessages(List messages) { - this.messages = messages; - } - - /** - * Checks if is anonymous. - * - * @return true, if is anonymous - */ - public boolean isAnonymous() { - return anonymous; - } - - /** - * Sets the anonymous. - * - * @param anonymous the new anonymous - */ - public void setAnonymous(boolean anonymous) { - this.anonymous = anonymous; - } - - /** - * Gets the user room token. - * - * @return the user room token - */ - public String getUserRoomToken() { - return userRoomToken; - } - - /** - * Sets the user room token. - * - * @param userRoomToken the new user room token - */ - public void setUserRoomToken(String userRoomToken) { - this.userRoomToken = userRoomToken; - } - - /** - * @return the jabberId - */ - public String getJabberId() { - return jabberId; - } - - /** - * @param jabberId the jabberId to set - */ - public void setJabberId(String jabberId) { - this.jabberId = jabberId; - } - - /** - * @return the jabberPassword - */ - public String getJabberPassword() { - return jabberPassword; - } - - /** - * @param jabberPassword the jabberPassword to set - */ - public void setJabberPassword(String jabberPassword) { - this.jabberPassword = jabberPassword; - } - - /** - * @return the mucRooms - */ - public List getMucRooms() { - return mucRooms; - } - - /** - * @param mucRooms the mucRooms to set - */ - public void setMucRooms(List mucRooms) { - this.mucRooms = mucRooms; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/model/UserReport.java b/partey/src/main/java/de/bstly/we/partey/api/controller/model/UserReport.java index e519081..ac19340 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/model/UserReport.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/model/UserReport.java @@ -3,9 +3,14 @@ */ package de.bstly.we.partey.api.controller.model; +import lombok.Getter; +import lombok.Setter; + /** * The Class UserReport. */ +@Getter +@Setter public class UserReport { private String reportedUserUuid; @@ -13,76 +18,4 @@ public class UserReport { private String reporterUserUuid; private String reportWorldSlug; - /** - * Gets the reported user uuid. - * - * @return the reported user uuid - */ - public String getReportedUserUuid() { - return reportedUserUuid; - } - - /** - * Sets the reported user uuid. - * - * @param reportedUserUuid the new reported user uuid - */ - public void setReportedUserUuid(String reportedUserUuid) { - this.reportedUserUuid = reportedUserUuid; - } - - /** - * Gets the reported user comment. - * - * @return the reported user comment - */ - public String getReportedUserComment() { - return reportedUserComment; - } - - /** - * Sets the reported user comment. - * - * @param reportedUserComment the new reported user comment - */ - public void setReportedUserComment(String reportedUserComment) { - this.reportedUserComment = reportedUserComment; - } - - /** - * Gets the reporter user uuid. - * - * @return the reporter user uuid - */ - public String getReporterUserUuid() { - return reporterUserUuid; - } - - /** - * Sets the reporter user uuid. - * - * @param reporterUserUuid the new reporter user uuid - */ - public void setReporterUserUuid(String reporterUserUuid) { - this.reporterUserUuid = reporterUserUuid; - } - - /** - * Gets the report world slug. - * - * @return the report world slug - */ - public String getReportWorldSlug() { - return reportWorldSlug; - } - - /** - * Sets the report world slug. - * - * @param reportWorldSlug the new report world slug - */ - public void setReportWorldSlug(String reportWorldSlug) { - this.reportWorldSlug = reportWorldSlug; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaCollection.java b/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaCollection.java index d450616..1584557 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaCollection.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaCollection.java @@ -4,68 +4,18 @@ package de.bstly.we.partey.api.controller.model; import java.util.List; +import lombok.Getter; +import lombok.Setter; /** * The Class WokaCollection. */ +@Getter +@Setter public class WokaCollection { private String name; private int position; private List textures; - /** - * 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 position. - * - * @return the position - */ - public int getPosition() { - return position; - } - - /** - * Sets the position. - * - * @param position the new position - */ - public void setPosition(int position) { - this.position = position; - } - - /** - * Gets the textures. - * - * @return the textures - */ - public List getTextures() { - return textures; - } - - /** - * Sets the textures. - * - * @param textures the new textures - */ - public void setTextures(List textures) { - this.textures = textures; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaLayer.java b/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaLayer.java index 7f7c60b..2705c71 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaLayer.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaLayer.java @@ -4,49 +4,16 @@ package de.bstly.we.partey.api.controller.model; import java.util.List; +import lombok.Getter; +import lombok.Setter; /** * The Class WokaLayer. */ +@Getter +@Setter public class WokaLayer { private boolean required; private List collections; - - /** - * Checks if is required. - * - * @return true, if is required - */ - public boolean isRequired() { - return required; - } - - /** - * Sets the required. - * - * @param required the new required - */ - public void setRequired(boolean required) { - this.required = required; - } - - /** - * Gets the collections. - * - * @return the collections - */ - public List getCollections() { - return collections; - } - - /** - * Sets the collections. - * - * @param collections the new collections - */ - public void setCollections(List collections) { - this.collections = collections; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaTexture.java b/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaTexture.java index fd2a1ff..8377d3d 100644 --- a/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaTexture.java +++ b/partey/src/main/java/de/bstly/we/partey/api/controller/model/WokaTexture.java @@ -3,9 +3,14 @@ */ package de.bstly.we.partey.api.controller.model; +import lombok.Getter; +import lombok.Setter; + /** * The Class WokaTexture. */ +@Getter +@Setter public class WokaTexture { private String id; @@ -13,76 +18,4 @@ public class WokaTexture { private String url; private int position; - /** - * Gets the id. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Sets the id. - * - * @param id the new id - */ - public void setId(String id) { - this.id = id; - } - - /** - * 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 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 position. - * - * @return the position - */ - public int getPosition() { - return position; - } - - /** - * Sets the position. - * - * @param position the new position - */ - public void setPosition(int position) { - this.position = position; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/businesslogic/model/Room.java b/partey/src/main/java/de/bstly/we/partey/businesslogic/model/Room.java index 3c9879a..c3c9a64 100644 --- a/partey/src/main/java/de/bstly/we/partey/businesslogic/model/Room.java +++ b/partey/src/main/java/de/bstly/we/partey/businesslogic/model/Room.java @@ -3,9 +3,14 @@ */ package de.bstly.we.partey.businesslogic.model; +import lombok.Getter; +import lombok.Setter; + /** * The Class Room. */ +@Getter +@Setter public class Room { private String url; @@ -13,72 +18,4 @@ public class Room { private String mapUrl; private boolean authenticationMandatory; - /** - * 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 map id. - * - * @return the map id - */ - public String getMapId() { - return mapId; - } - - /** - * Sets the map id. - * - * @param mapId the new map id - */ - public void setMapId(String mapId) { - this.mapId = mapId; - } - - /** - * Gets the map url. - * - * @return the map url - */ - public String getMapUrl() { - return mapUrl; - } - - /** - * Sets the map url. - * - * @param mapUrl the new map url - */ - public void setMapUrl(String mapUrl) { - this.mapUrl = mapUrl; - } - - /** - * @return the authenticationMandatory - */ - public boolean isAuthenticationMandatory() { - return authenticationMandatory; - } - - /** - * @param authenticationMandatory the authenticationMandatory to set - */ - public void setAuthenticationMandatory(boolean authenticationMandatory) { - this.authenticationMandatory = authenticationMandatory; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/model/ParteyMap.java b/partey/src/main/java/de/bstly/we/partey/model/ParteyMap.java index 2bc4065..651d398 100644 --- a/partey/src/main/java/de/bstly/we/partey/model/ParteyMap.java +++ b/partey/src/main/java/de/bstly/we/partey/model/ParteyMap.java @@ -15,12 +15,16 @@ import jakarta.persistence.Enumerated; import jakarta.persistence.FetchType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class ParteyMap. */ @Entity @Table(name = "partey_maps") +@Getter +@Setter public class ParteyMap { @Id @@ -31,58 +35,4 @@ public class ParteyMap { @CollectionTable(name = "partey_maps_tags") private List tags = Lists.newArrayList(); - /** - * Gets the id. - * - * @return the id - */ - public String getId() { - return id; - } - - /** - * Sets the id. - * - * @param id the new id - */ - public void setId(String id) { - this.id = id; - } - - /** - * Gets the policy type. - * - * @return the policy type - */ - public GameRoomPolicyTypes getPolicyType() { - return policyType; - } - - /** - * Sets the policy type. - * - * @param policyType the new policy type - */ - public void setPolicyType(GameRoomPolicyTypes policyType) { - this.policyType = policyType; - } - - /** - * Gets the tags. - * - * @return the tags - */ - public List getTags() { - return tags; - } - - /** - * Sets the tags. - * - * @param tags the new tags - */ - public void setTags(List tags) { - this.tags = tags; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReport.java b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReport.java index dad814e..144868d 100644 --- a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReport.java +++ b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReport.java @@ -11,11 +11,15 @@ import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; import jakarta.persistence.Lob; +import lombok.Getter; +import lombok.Setter; /** * The Class ParteyUserReport. */ @Entity +@Getter +@Setter public class ParteyUserReport { @Id @@ -30,112 +34,4 @@ public class ParteyUserReport { private String world; private Instant created; - /** - * 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 reporter. - * - * @return the reporter - */ - public Long getReporter() { - return reporter; - } - - /** - * Sets the reporter. - * - * @param reporter the new reporter - */ - public void setReporter(Long reporter) { - this.reporter = reporter; - } - - /** - * 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 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 world. - * - * @return the world - */ - public String getWorld() { - return world; - } - - /** - * Sets the world. - * - * @param world the new world - */ - public void setWorld(String world) { - this.world = world; - } - - /** - * Gets the created. - * - * @return the created - */ - public Instant getCreated() { - return created; - } - - /** - * Sets the created. - * - * @param created the new created - */ - public void setCreated(Instant created) { - this.created = created; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReportModerator.java b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReportModerator.java index 666325c..615857b 100644 --- a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReportModerator.java +++ b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserReportModerator.java @@ -8,11 +8,15 @@ import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; +import lombok.Getter; +import lombok.Setter; /** * The Class ParteyUserReportModerator. */ @Entity +@Getter +@Setter public class ParteyUserReportModerator { @Id @@ -23,58 +27,4 @@ public class ParteyUserReportModerator { @Column(columnDefinition = "boolean default false") private boolean disabled; - /** - * 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 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 disabled. - * - * @return true, if is disabled - */ - public boolean isDisabled() { - return disabled; - } - - /** - * Sets the disabled. - * - * @param disabled the new disabled - */ - public void setDisabled(boolean disabled) { - this.disabled = disabled; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTag.java b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTag.java index 545a3e6..f661e00 100644 --- a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTag.java +++ b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTag.java @@ -6,14 +6,17 @@ package de.bstly.we.partey.model; import java.io.Serializable; import java.time.Instant; +import de.bstly.we.model.UserData; +import de.bstly.we.partey.model.ParteyUserTag.ParteyUserTagId; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.IdClass; import jakarta.persistence.Table; - -import de.bstly.we.model.UserData; -import de.bstly.we.partey.model.ParteyUserTag.ParteyUserTagId; +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; /** * The Class ParteyUserTag. @@ -21,6 +24,8 @@ import de.bstly.we.partey.model.ParteyUserTag.ParteyUserTagId; @Entity @IdClass(ParteyUserTagId.class) @Table(name = "partey_user_tags") +@Getter +@Setter public class ParteyUserTag implements UserData { @Id @@ -34,99 +39,10 @@ public class ParteyUserTag implements UserData { @Column(name = "username", nullable = false) private String username; - /** - * Gets the target. - * - * @return the target - */ - public Long getTarget() { - return target; - } - - /** - * Sets the target. - * - * @param target the new target - */ - public void setTarget(Long target) { - this.target = target; - } - - /** - * Gets the tag. - * - * @return the tag - */ - public String getTag() { - return tag; - } - - /** - * Sets the tag. - * - * @param tag the new tag - */ - public void setTag(String tag) { - this.tag = tag; - } - - /** - * 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 expires. - * - * @return the expires - */ - public Instant getExpires() { - return expires; - } - - /** - * Sets the expires. - * - * @param expires the new expires - */ - public void setExpires(Instant expires) { - this.expires = expires; - } - - /** - * Gets the username. - * - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * Sets the username. - * - * @param username the new username - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * The Class ParteyUserTagId. - */ + @Getter + @Setter + @NoArgsConstructor + @AllArgsConstructor public static class ParteyUserTagId implements Serializable { private static final long serialVersionUID = 1L; @@ -134,61 +50,6 @@ public class ParteyUserTag implements UserData { private Long target; private String tag; - /** - * Instantiates a new partey user tag id. - */ - public ParteyUserTagId() { - super(); - } - - /** - * Instantiates a new partey user tag id. - * - * @param target the target - * @param tag the tag - */ - public ParteyUserTagId(Long target, String tag) { - super(); - this.target = target; - this.tag = tag; - } - - /** - * Gets the target. - * - * @return the target - */ - public Long getTarget() { - return target; - } - - /** - * Sets the target. - * - * @param target the new target - */ - public void setTarget(Long target) { - this.target = target; - } - - /** - * Gets the tag. - * - * @return the tag - */ - public String getTag() { - return tag; - } - - /** - * Sets the tag. - * - * @param tag the new tag - */ - public void setTag(String tag) { - this.tag = tag; - } - /* * @see java.lang.Object#equals(java.lang.Object) */ diff --git a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTextures.java b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTextures.java index d3e8bda..6e2188e 100644 --- a/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTextures.java +++ b/partey/src/main/java/de/bstly/we/partey/model/ParteyUserTextures.java @@ -15,12 +15,16 @@ import jakarta.persistence.Entity; import jakarta.persistence.FetchType; import jakarta.persistence.Id; import jakarta.persistence.Table; +import lombok.Getter; +import lombok.Setter; /** * The Class ParteyUserTextures. */ @Entity @Table(name = "partey_user_textures") +@Getter +@Setter public class ParteyUserTextures implements UserData { @Id @@ -31,58 +35,4 @@ public class ParteyUserTextures implements UserData { @CollectionTable(name = "partey_user_textures_list") private List textures = Lists.newArrayList(); - /** - * Gets the target. - * - * @return the target - */ - public Long getTarget() { - return target; - } - - /** - * Sets the target. - * - * @param target the new target - */ - public void setTarget(Long target) { - this.target = target; - } - - /** - * Gets the username. - * - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * Sets the username. - * - * @param username the new username - */ - public void setUsername(String username) { - this.username = username; - } - - /** - * Gets the textures. - * - * @return the textures - */ - public List getTextures() { - return textures; - } - - /** - * Sets the textures. - * - * @param textures the new textures - */ - public void setTextures(List textures) { - this.textures = textures; - } - } diff --git a/partey/src/main/java/de/bstly/we/partey/timeslot/model/Timeslot.java b/partey/src/main/java/de/bstly/we/partey/timeslot/model/Timeslot.java index 423ca06..773c8e8 100644 --- a/partey/src/main/java/de/bstly/we/partey/timeslot/model/Timeslot.java +++ b/partey/src/main/java/de/bstly/we/partey/timeslot/model/Timeslot.java @@ -18,12 +18,16 @@ import jakarta.persistence.Transient; import de.bstly.we.model.UserData; import de.bstly.we.model.Visibility; +import lombok.Getter; +import lombok.Setter; /** * The Class Timeslot. */ @Entity @Table(name = "timeslots") +@Getter +@Setter public class Timeslot implements UserData { @Id @@ -57,238 +61,4 @@ public class Timeslot implements UserData { @Transient private String username; - /** - * 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 type. - * - * @return the type - */ - public TimeslotType getType() { - return type; - } - - /** - * Sets the type. - * - * @param type the new type - */ - public void setType(TimeslotType type) { - this.type = type; - } - - /** - * 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 visibility. - * - * @return the visibility - */ - public Visibility getVisibility() { - return visibility; - } - - /** - * Sets the visibility. - * - * @param visibility the new visibility - */ - public void setVisibility(Visibility visibility) { - this.visibility = visibility; - } - - /** - * Gets the title. - * - * @return the title - */ - public String getTitle() { - return title; - } - - /** - * Sets the title. - * - * @param title the new title - */ - public void setTitle(String title) { - this.title = title; - } - - /** - * 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 share. - * - * @return the share - */ - public String getShare() { - return share; - } - - /** - * Sets the share. - * - * @param share the new share - */ - public void setShare(String share) { - this.share = share; - } - - /** - * Gets the stream. - * - * @return the stream - */ - public String getStream() { - return stream; - } - - /** - * Sets the stream. - * - * @param stream the new stream - */ - public void setStream(String stream) { - this.stream = stream; - } - - /** - * Gets the secret. - * - * @return the secret - */ - public String getSecret() { - return secret; - } - - /** - * Sets the secret. - * - * @param secret the new secret - */ - public void setSecret(String secret) { - this.secret = secret; - } - - /** - * Checks if is clear after. - * - * @return true, if is clear after - */ - public boolean isClearAfter() { - return clearAfter; - } - - /** - * Sets the clear after. - * - * @param clearAfter the new clear after - */ - public void setClearAfter(boolean clearAfter) { - this.clearAfter = clearAfter; - } - - /** - * Gets the username. - * - * @return the username - */ - public String getUsername() { - return username; - } - - /** - * Sets the username. - * - * @param username the new username - */ - public void setUsername(String username) { - this.username = username; - } - } diff --git a/pom.xml b/pom.xml index 6103304..7677d6b 100755 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 2.2 1.14.1 3.6.3 - 3.6.0 + 3.7.0 diff --git a/services/pom.xml b/services/pom.xml index ba53727..0336283 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -30,5 +30,12 @@ ${querydsl.version} jakarta + + + + org.projectlombok + lombok + true + diff --git a/services/src/main/java/de/bstly/we/services/model/Service.java b/services/src/main/java/de/bstly/we/services/model/Service.java index 59f8ab5..2ffac57 100644 --- a/services/src/main/java/de/bstly/we/services/model/Service.java +++ b/services/src/main/java/de/bstly/we/services/model/Service.java @@ -8,12 +8,18 @@ import jakarta.persistence.Entity; import jakarta.persistence.Id; import jakarta.persistence.Table; import jakarta.persistence.UniqueConstraint; +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; /** * The Class Service. */ @Entity @Table(name = "services", uniqueConstraints = @UniqueConstraint(columnNames = { "name" })) +@Getter +@Setter +@NoArgsConstructor public class Service { @Id @@ -29,14 +35,6 @@ public class Service { private String permission; @Column(name = "category") private String category; - - /** - * Instantiates a new service. - */ - public Service() { - super(); - } - /** * Instantiates a new service. * @@ -49,112 +47,4 @@ public class Service { this.url = url; } - /** - * 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 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; - } - - /** - * Checks if is always permitted. - * - * @return true, if is always permitted - */ - public boolean isAlwaysPermitted() { - return alwaysPermitted; - } - - /** - * Sets the always permitted. - * - * @param alwaysPermitted the new always permitted - */ - public void setAlwaysPermitted(boolean alwaysPermitted) { - this.alwaysPermitted = alwaysPermitted; - } - - /** - * Checks if is same site. - * - * @return true, if is same site - */ - public boolean isSameSite() { - return sameSite; - } - - /** - * Sets the same site. - * - * @param sameSite the new same site - */ - public void setSameSite(boolean sameSite) { - this.sameSite = sameSite; - } - - /** - * Gets the permission. - * - * @return the permission - */ - public String getPermission() { - return permission; - } - - /** - * Sets the permission. - * - * @param permission the new permission - */ - public void setPermission(String permission) { - this.permission = permission; - } - - /** - * Gets the category. - * - * @return the category - */ - public String getCategory() { - return category; - } - - /** - * Sets the category. - * - * @param category the new category - */ - public void setCategory(String category) { - this.category = category; - } - } diff --git a/urlshortener/pom.xml b/urlshortener/pom.xml index 251617b..46b9941 100755 --- a/urlshortener/pom.xml +++ b/urlshortener/pom.xml @@ -25,5 +25,12 @@ ${querydsl.version} jakarta + + + + org.projectlombok + lombok + true + diff --git a/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/model/ShortenedUrlModel.java b/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/model/ShortenedUrlModel.java index ef1a19c..bc067b7 100644 --- a/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/model/ShortenedUrlModel.java +++ b/urlshortener/src/main/java/de/bstly/we/urlshortener/controller/model/ShortenedUrlModel.java @@ -4,10 +4,14 @@ package de.bstly.we.urlshortener.controller.model; import java.time.Instant; +import lombok.Getter; +import lombok.Setter; /** * The Class ShortenedUrlModel. */ +@Getter +@Setter public class ShortenedUrlModel { private String code; @@ -20,166 +24,4 @@ public class ShortenedUrlModel { private boolean queryParameters; private boolean newPassword; - /** - * Gets the code. - * - * @return the code - */ - public String getCode() { - return code; - } - - /** - * Sets the code. - * - * @param code the new code - */ - public void setCode(String code) { - this.code = code; - } - - /** - * Gets the new code. - * - * @return the new code - */ - public String getNewCode() { - return newCode; - } - - /** - * Sets the new code. - * - * @param newCode the new new code - */ - public void setNewCode(String newCode) { - this.newCode = newCode; - } - - /** - * 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 note. - * - * @return the note - */ - public String getNote() { - return note; - } - - /** - * Sets the note. - * - * @param note the new note - */ - public void setNote(String note) { - this.note = note; - } - - /** - * Gets the expires. - * - * @return the expires - */ - public Instant getExpires() { - return expires; - } - - /** - * Sets the expires. - * - * @param expires the new expires - */ - public void setExpires(Instant expires) { - this.expires = expires; - } - - /** - * Gets the password. - * - * @return the password - */ - public String getPassword() { - return password; - } - - /** - * Sets the password. - * - * @param password the new password - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * Gets the password 2. - * - * @return the password 2 - */ - public String getPassword2() { - return password2; - } - - /** - * Sets the password 2. - * - * @param password2 the new password 2 - */ - public void setPassword2(String password2) { - this.password2 = password2; - } - - /** - * Checks if is query parameters. - * - * @return true, if is query parameters - */ - public boolean isQueryParameters() { - return queryParameters; - } - - /** - * Sets the query parameters. - * - * @param queryParameters the new query parameters - */ - public void setQueryParameters(boolean queryParameters) { - this.queryParameters = queryParameters; - } - - /** - * Checks if is new password. - * - * @return true, if is new password - */ - public boolean isNewPassword() { - return newPassword; - } - - /** - * Sets the new password. - * - * @param newPassword the new new password - */ - public void setNewPassword(boolean newPassword) { - this.newPassword = newPassword; - } - } diff --git a/urlshortener/src/main/java/de/bstly/we/urlshortener/model/ShortenedUrl.java b/urlshortener/src/main/java/de/bstly/we/urlshortener/model/ShortenedUrl.java index 8595bac..b44678e 100644 --- a/urlshortener/src/main/java/de/bstly/we/urlshortener/model/ShortenedUrl.java +++ b/urlshortener/src/main/java/de/bstly/we/urlshortener/model/ShortenedUrl.java @@ -5,14 +5,6 @@ package de.bstly.we.urlshortener.model; import java.time.Instant; -import jakarta.persistence.Column; -import jakarta.persistence.Entity; -import jakarta.persistence.EntityListeners; -import jakarta.persistence.Id; -import jakarta.persistence.Lob; -import jakarta.persistence.Table; -import jakarta.persistence.Transient; - import org.springframework.util.StringUtils; import com.fasterxml.jackson.annotation.JsonIgnore; @@ -20,6 +12,15 @@ import com.fasterxml.jackson.annotation.JsonProperty; import de.bstly.we.businesslogic.support.AbstractModelEventListener; import de.bstly.we.model.UserData; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityListeners; +import jakarta.persistence.Id; +import jakarta.persistence.Lob; +import jakarta.persistence.Table; +import jakarta.persistence.Transient; +import lombok.Getter; +import lombok.Setter; /** * The Class ShortenedUrl. @@ -27,6 +28,8 @@ import de.bstly.we.model.UserData; @Entity @Table(name = "shortened_urls") @EntityListeners(AbstractModelEventListener.class) +@Getter +@Setter public class ShortenedUrl implements UserData { @Id @@ -50,157 +53,7 @@ public class ShortenedUrl implements UserData { @Transient private boolean hasPassword; - /** - * Gets the code. - * - * @return the code - */ - public String getCode() { - return code; - } - - /** - * Sets the code. - * - * @param code the new code - */ - public void setCode(String code) { - this.code = code; - } - - /** - * 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 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 expires. - * - * @return the expires - */ - public Instant getExpires() { - return expires; - } - - /** - * Sets the expires. - * - * @param expires the new expires - */ - public void setExpires(Instant expires) { - this.expires = expires; - } - - /** - * Gets the password hash. - * - * @return the password hash - */ - public String getPasswordHash() { - return passwordHash; - } - - /** - * Sets the password hash. - * - * @param passwordHash the new password hash - */ - public void setPasswordHash(String passwordHash) { - this.passwordHash = passwordHash; - } - - /** - * Gets the link. - * - * @return the link - */ - public String getLink() { - return link; - } - - /** - * Sets the link. - * - * @param link the new link - */ - public void setLink(String link) { - this.link = link; - } - - /** - * Gets the note. - * - * @return the note - */ - public String getNote() { - return note; - } - - /** - * Sets the note. - * - * @param note the new note - */ - public void setNote(String note) { - this.note = note; - } - - /** - * Checks if is query parameters. - * - * @return true, if is query parameters - */ - public boolean isQueryParameters() { - return queryParameters; - } - - /** - * Sets the query parameters. - * - * @param queryParameters the new query parameters - */ - public void setQueryParameters(boolean queryParameters) { - this.queryParameters = queryParameters; - } - - /** - * Checks if is checks for password. - * - * @return true, if is checks for password - */ public boolean isHasPassword() { return StringUtils.hasText(passwordHash); } - }