This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package repository; | |
| @Repository | |
| public interface CandidateProfileRepository | |
| extends BaseRepository<CandidateProfile, Long>, CandidateProfileRepositoryCustom { | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // filter(), findAny() and orElse() | |
| Item item = items.stream() | |
| .filter(item -> Objects.equals(item.getId(), itemId)) | |
| .findAny() | |
| .orElse(null); | |
| // findFirst | |
| Optional<Item> itemOpt = items.stream() | |
| .filter(item -> Objects.equals(item.getId(), itemId)) | |
| .findFirst(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Java 9 | |
| private static final Map<String, String> test = Map.of("a", "b", "c", "d"); | |
| private static final Map<String, String> test2 = Map.ofEntries( | |
| entry("a", "b"), | |
| entry("c", "d") | |
| ); | |
| // Java 8 | |
| HashMap<String, String> h = new HashMap<String, String>() {{ | |
| put("a","b"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.apache.commons.lang3.StringUtils; | |
| String a = null; | |
| System.out.println(StringUtils.defaultString(a)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Inverse boolean value | |
| SELECT (ca.deleteFlag=false) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| spring: | |
| mail: | |
| default-encoding: UTF-8 | |
| host: localhost | |
| username: anyname | |
| password: anypassword | |
| port: 2525 | |
| properties: | |
| mail: | |
| smtp: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 1 Param | |
| LOGGER.log(Level.INFO, "Hello {0}", "World"}); | |
| // Many params | |
| LOGGER.log(Level.INFO, "Hello {0} {1}", new Object[] {"World", "!"}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Collections.singletonList(object) | |
| Collections.emptyList() == new ArrayList<>() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return ResponseEntity.badRequest().body(response); | |
| return ResponseEntity.ok(response); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <tiles:importAttribute name="stage"/> | |
| <tiles:importAttribute name="qualified"/> | |
| <tiles:importAttribute name="candidates"/> | |
| <c:out value="${stage}" /> | |
| <c:out value="${qualified}" /> |
OlderNewer