Skip to content

Instantly share code, notes, and snippets.

View theboreddev's full-sized avatar
💭
💻

The Bored Dev theboreddev

💭
💻
View GitHub Profile
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")
final String multiLineText = """
{"widget": {
"debug": "on",
"window": {
"title": "Sample Konfabulator Widget",
"name": "main_window",
"width": 500,
"height": 500
},
"image": {\s
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" +
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;
final DayOfTheWeek dayOfTheWeek = DayOfTheWeek.THURSDAY;
int position = 0;
switch (dayOfTheWeek) {
case MONDAY:
position = 1;
break;
case TUESDAY:
position = 2;
@theboreddev
theboreddev / DayOfTheWeek.java
Created July 24, 2020 11:55
day_of_week day_of_week
public enum DayOfTheWeek {
MONDAY,
TUESDAY,
WEDNESDAY,
THURSDAY,
FRIDAY,
SATURDAY,
SUNDAY
}
public enum AgeRange {
UNDER_TWENTY,
UNDER_THIRTY,
UNDER_FORTY,
UNDER_FIFTY,
FIFTY_OR_MORE
}
public record AddressRecord(String firstLine, String secondLine, String postCode) {
}
public record EmployeeRecord(String firstName, String surname, int age, AddressRecord address, double salary) {
}