From 55293b4ac33e0f4fd2bfce3a0f5783b42812a65c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Wed, 21 Dec 2022 02:17:29 +0300 Subject: webfinger, app-site-associations: adopt records --- .../juick/www/api/apple/AppSiteAssociation.java | 33 ++++------------------ 1 file changed, 5 insertions(+), 28 deletions(-) (limited to 'src/main/java/com/juick/www/api/apple') diff --git a/src/main/java/com/juick/www/api/apple/AppSiteAssociation.java b/src/main/java/com/juick/www/api/apple/AppSiteAssociation.java index c0827003..19839254 100644 --- a/src/main/java/com/juick/www/api/apple/AppSiteAssociation.java +++ b/src/main/java/com/juick/www/api/apple/AppSiteAssociation.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008-2020, Juick + * Copyright (C) 2008-2022, Juick * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as @@ -35,36 +35,13 @@ public class AppSiteAssociation { @GetMapping("/.well-known/apple-app-site-association") @ResponseBody public SiteAssociations appSiteAssociations() { - WebCredentials webCredentials = new WebCredentials(); - webCredentials.setApps(Collections.singletonList(appId)); - SiteAssociations siteAssociations = new SiteAssociations(); - siteAssociations.setWebcredentials(webCredentials); - return siteAssociations; + WebCredentials webCredentials = new WebCredentials(Collections.singletonList(appId)); + return new SiteAssociations(webCredentials); } - private class SiteAssociations { - private WebCredentials webcredentials; - - @JsonProperty - public WebCredentials getWebcredentials() { - return webcredentials; - } - - public void setWebcredentials(WebCredentials webcredentials) { - this.webcredentials = webcredentials; - } + private record SiteAssociations(WebCredentials webcredentials) { } - private class WebCredentials { - private List apps; - - @JsonProperty - public List getApps() { - return apps; - } - - public void setApps(List apps) { - this.apps = apps; - } + private record WebCredentials(List apps) { } } -- cgit v1.2.3