From 29e01404c24c69e8742e21a96237c07dec67c82f Mon Sep 17 00:00:00 2001 From: Sergey Grigoriev Date: Tue, 2 Jul 2024 12:32:44 +0200 Subject: [PATCH] feat: migrated to generic v6.0.0 --- .../rest/ApiExtenderRestApplication.java | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/src/main/java/ch/sbb/polarion/extension/api/extender/rest/ApiExtenderRestApplication.java b/src/main/java/ch/sbb/polarion/extension/api/extender/rest/ApiExtenderRestApplication.java index f89e470..d85ef88 100644 --- a/src/main/java/ch/sbb/polarion/extension/api/extender/rest/ApiExtenderRestApplication.java +++ b/src/main/java/ch/sbb/polarion/extension/api/extender/rest/ApiExtenderRestApplication.java @@ -7,34 +7,30 @@ import ch.sbb.polarion.extension.api.extender.settings.GlobalRecordsSettings; import ch.sbb.polarion.extension.api.extender.settings.ProjectCustomFieldsSettings; import ch.sbb.polarion.extension.generic.rest.GenericRestApplication; -import ch.sbb.polarion.extension.generic.settings.GenericNamedSettings; import ch.sbb.polarion.extension.generic.settings.NamedSettingsRegistry; import org.jetbrains.annotations.NotNull; -import java.util.ArrayList; -import java.util.List; +import java.util.Arrays; import java.util.Set; public class ApiExtenderRestApplication extends GenericRestApplication { public ApiExtenderRestApplication() { - List> settingsList = new ArrayList<>(); - settingsList.add(new GlobalRecordsSettings()); - settingsList.add(new ProjectCustomFieldsSettings()); - - NamedSettingsRegistry.INSTANCE.register(settingsList); + NamedSettingsRegistry.INSTANCE.register( + Arrays.asList( + new GlobalRecordsSettings(), + new ProjectCustomFieldsSettings() + ) + ); } @Override - @NotNull - protected Set> getControllerClasses() { - final Set> controllerClasses = super.getControllerClasses(); - controllerClasses.addAll(Set.of( - GlobalRecordApiController.class, - GlobalRecordInternalController.class, - ProjectCustomFieldApiController.class, - ProjectCustomFieldInternalController.class - )); - return controllerClasses; + protected @NotNull Set getExtensionControllerSingletons() { + return Set.of( + new GlobalRecordApiController(), + new GlobalRecordInternalController(), + new ProjectCustomFieldApiController(), + new ProjectCustomFieldInternalController() + ); } }