diff options
author | Vitaly Takmazov | 2022-12-21 01:18:05 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2022-12-21 02:00:31 +0300 |
commit | a740c0e1d4e9f89ef7decfe4225e53555121f93b (patch) | |
tree | 4a28bcdffc0c4ede163dd4a03a29ab4984fb39a3 /src/main/java/com/juick/www/api/activity | |
parent | 79d1eeadf3cda6790e33c18e669cd8b8c3f12196 (diff) |
Switch from `lombok` to Java 17 `record`
Diffstat (limited to 'src/main/java/com/juick/www/api/activity')
-rw-r--r-- | src/main/java/com/juick/www/api/activity/converters/UserToActorConverter.java | 12 | ||||
-rw-r--r-- | src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java | 10 |
2 files changed, 3 insertions, 19 deletions
diff --git a/src/main/java/com/juick/www/api/activity/converters/UserToActorConverter.java b/src/main/java/com/juick/www/api/activity/converters/UserToActorConverter.java index 435cb50d..0ba047b5 100644 --- a/src/main/java/com/juick/www/api/activity/converters/UserToActorConverter.java +++ b/src/main/java/com/juick/www/api/activity/converters/UserToActorConverter.java @@ -13,15 +13,8 @@ import com.juick.www.api.activity.model.objects.Image; import com.juick.www.api.activity.model.objects.Key; import com.juick.www.api.activity.model.objects.Person; -import lombok.AllArgsConstructor; - -@AllArgsConstructor -public class UserToActorConverter implements Converter<User, Actor> { - - private ProfileUriBuilder profileUriBuilder; - private KeystoreManager keystoreManager; - private WebApp webApp; - +public record UserToActorConverter(ProfileUriBuilder profileUriBuilder, KeystoreManager keystoreManager, WebApp webApp) + implements Converter<User, Actor> { @Override public Actor convert(User user) { Actor profile = user.isService() ? new Application() : new Person(); @@ -44,5 +37,4 @@ public class UserToActorConverter implements Converter<User, Actor> { profile.setIcon(avatar); return (Actor) Context.build(profile); } - } diff --git a/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java b/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java index 8f5e7566..e10c3078 100644 --- a/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java +++ b/src/main/java/com/juick/www/api/activity/helpers/ProfileUriBuilder.java @@ -20,18 +20,10 @@ package com.juick.www.api.activity.helpers; import com.juick.model.Message; import com.juick.model.Tag; import com.juick.model.User; -import lombok.AllArgsConstructor; import org.springframework.web.util.UriComponents; import org.springframework.web.util.UriComponentsBuilder; -@AllArgsConstructor -public class ProfileUriBuilder { - private String baseUri; - - public String getBaseUri() { - return baseUri; - } - +public record ProfileUriBuilder(String baseUri) { public String inboxUri() { UriComponentsBuilder uri = UriComponentsBuilder.fromUriString(baseUri); return uri.replacePath("/api/inbox").toUriString(); |