Skip to content

Update methods to use java 11 #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.divit.springboot.application.controller;

import java.util.List;
import java.util.stream.Collectors;

import org.springframework.http.ResponseEntity;
Expand All @@ -10,7 +9,6 @@
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.divit.springboot.application.model.Candidate;
import com.divit.springboot.application.util.CandidatesUtil;

import lombok.extern.slf4j.Slf4j;
Expand All @@ -25,7 +23,7 @@ public ResponseEntity<?> fetchCandidates(@RequestParam(value = "skill", required
log.info("Response received. Params: skill {}", skill);

// Simple util to help us get some dummy data
List<Candidate> candidateList = CandidatesUtil.getCandidates();
var candidateList = CandidatesUtil.getCandidates();
if (!StringUtils.isEmpty(skill)) {
// Filter by skill
return ResponseEntity.ok(candidateList.stream()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package com.divit.springboot.application.util;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.divit.springboot.application.model.Candidate;

Expand All @@ -19,11 +17,11 @@ private CandidatesUtil() {
* @return list of candidates
*/
public static List<Candidate> getCandidates() {
List<Candidate> candidateList = new ArrayList<>();
candidateList.add(new Candidate("John", 2, new HashSet<String>(Arrays.asList("java", "c#", "c++", "golang"))));
candidateList.add(new Candidate("David", 1, new HashSet<String>(Arrays.asList("javaScript", "c++"))));
candidateList.add(new Candidate("Diana", 4, new HashSet<String>(Arrays.asList("java", "python"))));
candidateList.add(new Candidate("June", 2, new HashSet<String>(Arrays.asList("ruby", "aws", "docker"))));
var candidateList = List.of(
new Candidate("John", 2, Set.of("java", "c#", "c++", "golang")),
new Candidate("David", 1, Set.of("javaScript", "c++")),
new Candidate("Diana", 4, Set.of("java", "python")),
new Candidate("June", 2, Set.of("ruby", "aws", "docker")));

return candidateList;
}
Expand Down