Create utility class to provide easy access to List of Parameters #21

Closed
opened 2026-03-27 17:22:07 +01:00 by lars.winzer · 8 comments
lars.winzer commented 2026-03-27 17:22:07 +01:00 (Migrated from git.scicore.unibas.ch)

Feature Request

Summary

Utility class to provide easy access via methods to list of parameters wrapped in PrimitiveRequest, used in each implementation of the CommandParser.

Required workarround

Each implementation of the CommandParser needs to repeatedly:

  1. Check if the required parameter are present
  2. Convert from String to another type

If one of both conditions aren't met, the processing must be aborted and the client must be informed.

Description

Special RequestParameterAccessor class taking the list of parameters during instantiation.

This class should provide methods to get a value based on its key. A default value can be provided to be returned when no parameter is found.

Another overloaded variant could allow to provide a function (e.g. Integer::fromString ) to implicitly convert to the desired type.

Checklist

  • I reproduced the problem using the steps above
  • I searched documentation docs for relevant information
  • I added relevant labels
## Feature Request <!--The reccommended type is: Task--> ### Summary Utility class to provide easy access via methods to list of parameters wrapped in `PrimitiveRequest`, used in each implementation of the `CommandParser`. ### Required workarround Each implementation of the CommandParser needs to repeatedly: 1. Check if the required parameter are present 2. Convert from String to another type If one of both conditions aren't met, the processing must be aborted and the client must be informed. ### Description Special `RequestParameterAccessor` class taking the list of parameters during instantiation. This class should provide methods to get a value based on its key. A default value can be provided to be returned when no parameter is found. Another overloaded variant could allow to provide a function (e.g. `Integer::fromString` ) to implicitly convert to the desired type. ### Checklist - [x] ~~I reproduced the problem using the steps above~~ - [x] ~~I searched documentation docs for relevant information~~ - [x] I added relevant labels
lars.winzer commented 2026-03-30 11:37:26 +02:00 (Migrated from git.scicore.unibas.ch)

assigned to @lars.winzer

assigned to @lars.winzer
lars.winzer commented 2026-03-30 11:38:17 +02:00 (Migrated from git.scicore.unibas.ch)

created branch feat/21-requestparameteraccessor to address this issue

created branch [`feat/21-requestparameteraccessor`](/cs108-fs26/Gruppe-13/-/compare/main...feat%2F21-requestparameteraccessor) to address this issue
lars.winzer commented 2026-03-30 13:04:03 +02:00 (Migrated from git.scicore.unibas.ch)

added 20m of time spent at 2026-03-30 12:00:00 +0200

added 20m of time spent at 2026-03-30 12:00:00 +0200
lars.winzer commented 2026-03-30 13:04:39 +02:00 (Migrated from git.scicore.unibas.ch)

added 1h of time spent at 2026-03-30 12:00:00 +0200

added 1h of time spent at 2026-03-30 12:00:00 +0200
lars.winzer commented 2026-03-30 13:22:19 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in merge request !52

mentioned in merge request !52
lars.winzer commented 2026-03-30 13:25:47 +02:00 (Migrated from git.scicore.unibas.ch)

created branch chore/21-fix-style to address this issue

created branch [`chore/21-fix-style`](/cs108-fs26/Gruppe-13/-/compare/main...chore%2F21-fix-style) to address this issue
lars.winzer commented 2026-03-30 13:30:24 +02:00 (Migrated from git.scicore.unibas.ch)

mentioned in merge request !53

mentioned in merge request !53
lars.winzer (Migrated from git.scicore.unibas.ch) closed this issue 2026-03-30 13:31:56 +02:00
lars.winzer commented 2026-03-30 13:31:57 +02:00 (Migrated from git.scicore.unibas.ch)
Used https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13/-/merge_requests/53 to fix line length formatting violations introduced in https://git.scicore.unibas.ch/cs108-fs26/Gruppe-13/-/merge_requests/52
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: University-of-Basel-Studentprojects/Programmierprojekt#21