aboutsummaryrefslogtreecommitdiffstats
path: root/pnfsimulator
diff options
context:
space:
mode:
authorBogumil Zebek <bogumil.zebek@nokia.com>2020-04-21 12:22:41 +0200
committerZebek Bogumil <bogumil.zebek@nokia.com>2020-04-21 12:22:41 +0200
commit8e0539cfa4ee4815f59859df0add2247f584e029 (patch)
tree4d6fcb4151a71993bc1831549719dc1638b6904d /pnfsimulator
parent7a72af49aa1fd4d1b4106f0a976443590fd69815 (diff)
Remove usage of generic wildcard type
It is highly recommended not to use wildcard types as return types. Because the type inference rules are fairly complex it is unlikely the user of that API will know how to use it correctly. Issue-ID: INT-1517 Signed-off-by: Zebek Bogumil <bogumil.zebek@nokia.com> Change-Id: Ib7fac9587e158afce6856309dfb2f397661c72b9
Diffstat (limited to 'pnfsimulator')
-rw-r--r--pnfsimulator/src/main/java/org/onap/pnfsimulator/rest/TemplateController.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/pnfsimulator/src/main/java/org/onap/pnfsimulator/rest/TemplateController.java b/pnfsimulator/src/main/java/org/onap/pnfsimulator/rest/TemplateController.java
index 444e23b..7eaa9ff 100644
--- a/pnfsimulator/src/main/java/org/onap/pnfsimulator/rest/TemplateController.java
+++ b/pnfsimulator/src/main/java/org/onap/pnfsimulator/rest/TemplateController.java
@@ -30,8 +30,6 @@ import org.onap.pnfsimulator.rest.model.TemplateRequest;
import org.onap.pnfsimulator.rest.model.SearchExp;
import org.onap.pnfsimulator.template.Template;
import org.onap.pnfsimulator.template.search.IllegalJsonValueException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatus;
@@ -53,7 +51,6 @@ public class TemplateController {
static final String TEMPLATE_NOT_FOUND_MSG = "A template with given name does not exist";
static final String CANNOT_OVERRIDE_TEMPLATE_MSG = "Cannot overwrite existing template. Use override=true to override";
private final Storage<Template> service;
- private static final Logger LOG = LoggerFactory.getLogger(TemplateController.class);
@Autowired
public TemplateController(Storage<Template> service) {
@@ -61,7 +58,7 @@ public class TemplateController {
}
@GetMapping("list")
- public ResponseEntity<?> list() {
+ public ResponseEntity<List<Template>> list() {
return new ResponseEntity<>(service.getAll(), HttpStatus.OK);
}
@@ -77,7 +74,7 @@ public class TemplateController {
}
@PostMapping("upload")
- public ResponseEntity<?> upload(
+ public ResponseEntity<String> upload(
@RequestBody @Valid TemplateRequest templateRequest,
@RequestParam(required = false) boolean override) {
String msg = "";
@@ -91,7 +88,7 @@ public class TemplateController {
}
@PostMapping("search")
- public ResponseEntity<?> searchByCriteria(@RequestBody SearchExp queryJson) {
+ public ResponseEntity<List<String>> searchByCriteria(@RequestBody SearchExp queryJson) {
try {
List<String> templateNames = service.getIdsByContentCriteria(queryJson.getSearchExpr());
return new ResponseEntity<>(templateNames, HttpStatus.OK);