This file has been truncated, but you can view the full file.
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 com.theboreddev.springbootapp | |
import org.springframework.beans.factory.annotation.Autowired | |
import org.springframework.beans.factory.annotation.Value | |
import org.springframework.http.ResponseEntity | |
import org.springframework.web.bind.annotation.* | |
import org.springframework.web.util.UriComponentsBuilder | |
@RestController | |
@RequestMapping("/api/customers") |
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
final String multiLineText = """ | |
{"widget": { | |
"debug": "on", | |
"window": { | |
"title": "Sample Konfabulator Widget", | |
"name": "main_window", | |
"width": 500, | |
"height": 500 | |
}, | |
"image": {\s |
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
final String text = "{\"widget\": {\n" + | |
" \"debug\": \"on\",\n" + | |
" \"window\": {\n" + | |
" \"title\": \"Sample Konfabulator Widget\",\n" + | |
" \"name\": \"main_window\",\n" + | |
" \"width\": 500,\n" + | |
" \"height\": 500\n" + | |
" },\n" + | |
" \"image\": { \n" + | |
" \"src\": \"Images/Sun.png\",\n" + |
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
final DayOfTheWeek dayOfTheWeek = DayOfTheWeek.THURSDAY; | |
int position = switch (dayOfTheWeek) { | |
case MONDAY -> 1; | |
case TUESDAY -> 2; | |
case WEDNESDAY -> 3; | |
case THURSDAY -> 4; | |
case FRIDAY -> 5; | |
case SATURDAY -> 6; | |
case SUNDAY -> 7; |
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
final DayOfTheWeek dayOfTheWeek = DayOfTheWeek.THURSDAY; | |
int position = 0; | |
switch (dayOfTheWeek) { | |
case MONDAY: | |
position = 1; | |
break; | |
case TUESDAY: | |
position = 2; |
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
public enum DayOfTheWeek { | |
MONDAY, | |
TUESDAY, | |
WEDNESDAY, | |
THURSDAY, | |
FRIDAY, | |
SATURDAY, | |
SUNDAY | |
} |
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
public enum AgeRange { | |
UNDER_TWENTY, | |
UNDER_THIRTY, | |
UNDER_FORTY, | |
UNDER_FIFTY, | |
FIFTY_OR_MORE | |
} |
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
public record AddressRecord(String firstLine, String secondLine, String postCode) { | |
} |
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
public record EmployeeRecord(String firstName, String surname, int age, AddressRecord address, double salary) { | |
} |
NewerOlder