Skip to content

Commit 2ab201d

Browse files
author
eugenp
committed
cleanup work
1 parent a44be73 commit 2ab201d

49 files changed

Lines changed: 514 additions & 678 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

core-java/src/main/java/com/baeldung/datetime/UseDuration.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
import java.time.Period;
66

77
public class UseDuration {
8-
9-
public LocalTime modifyDates(LocalTime localTime,Duration duration){
8+
9+
public LocalTime modifyDates(LocalTime localTime, Duration duration) {
1010
return localTime.plus(duration);
1111
}
12-
13-
public Duration getDifferenceBetweenDates(LocalTime localTime1,LocalTime localTime2){
12+
13+
public Duration getDifferenceBetweenDates(LocalTime localTime1, LocalTime localTime2) {
1414
return Duration.between(localTime1, localTime2);
1515
}
1616
}

core-java/src/main/java/com/baeldung/datetime/UseLocalDate.java

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,39 @@
77
import java.time.temporal.TemporalAdjusters;
88

99
public class UseLocalDate {
10-
11-
public LocalDate getLocalDateUsingFactoryOfMethod(int year, int month, int dayOfMonth){
10+
11+
public LocalDate getLocalDateUsingFactoryOfMethod(int year, int month, int dayOfMonth) {
1212
return LocalDate.of(year, month, dayOfMonth);
1313
}
14-
15-
public LocalDate getLocalDateUsingParseMethod(String representation){
14+
15+
public LocalDate getLocalDateUsingParseMethod(String representation) {
1616
return LocalDate.parse(representation);
1717
}
18-
19-
public LocalDate getLocalDateFromClock(){
18+
19+
public LocalDate getLocalDateFromClock() {
2020
LocalDate localDate = LocalDate.now();
2121
return localDate;
2222
}
23-
24-
public LocalDate getNextDay(LocalDate localDate){
23+
24+
public LocalDate getNextDay(LocalDate localDate) {
2525
return localDate.plusDays(1);
2626
}
27-
28-
public LocalDate getPreviousDay(LocalDate localDate){
27+
28+
public LocalDate getPreviousDay(LocalDate localDate) {
2929
return localDate.minus(1, ChronoUnit.DAYS);
3030
}
31-
32-
public DayOfWeek getDayOfWeek(LocalDate localDate){
31+
32+
public DayOfWeek getDayOfWeek(LocalDate localDate) {
3333
DayOfWeek day = localDate.getDayOfWeek();
3434
return day;
3535
}
36-
37-
public LocalDate getFirstDayOfMonth(){
36+
37+
public LocalDate getFirstDayOfMonth() {
3838
LocalDate firstDayOfMonth = LocalDate.now().with(TemporalAdjusters.firstDayOfMonth());
3939
return firstDayOfMonth;
4040
}
41-
42-
public LocalDateTime getStartOfDay(LocalDate localDate){
41+
42+
public LocalDateTime getStartOfDay(LocalDate localDate) {
4343
LocalDateTime startofDay = localDate.atStartOfDay();
4444
return startofDay;
4545
}

core-java/src/main/java/com/baeldung/datetime/UseLocalDateTime.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import java.time.LocalDateTime;
44

55
public class UseLocalDateTime {
6-
7-
public LocalDateTime getLocalDateTimeUsingParseMethod(String representation){
6+
7+
public LocalDateTime getLocalDateTimeUsingParseMethod(String representation) {
88
return LocalDateTime.parse(representation);
99
}
1010

core-java/src/main/java/com/baeldung/datetime/UseLocalTime.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@
44
import java.time.temporal.ChronoUnit;
55

66
public class UseLocalTime {
7-
8-
public LocalTime getLocalTimeUsingFactoryOfMethod(int hour, int min, int seconds){
7+
8+
public LocalTime getLocalTimeUsingFactoryOfMethod(int hour, int min, int seconds) {
99
LocalTime localTime = LocalTime.of(hour, min, seconds);
1010
return localTime;
1111
}
12-
13-
public LocalTime getLocalTimeUsingParseMethod(String timeRepresentation){
12+
13+
public LocalTime getLocalTimeUsingParseMethod(String timeRepresentation) {
1414
LocalTime localTime = LocalTime.parse(timeRepresentation);
1515
return localTime;
1616
}
17-
18-
public LocalTime getLocalTimeFromClock(){
17+
18+
public LocalTime getLocalTimeFromClock() {
1919
LocalTime localTime = LocalTime.now();
2020
return localTime;
2121
}
22-
23-
public LocalTime addAnHour(LocalTime localTime){
24-
LocalTime newTime = localTime.plus(1,ChronoUnit.HOURS);
22+
23+
public LocalTime addAnHour(LocalTime localTime) {
24+
LocalTime newTime = localTime.plus(1, ChronoUnit.HOURS);
2525
return newTime;
2626
}
27-
28-
public int getHourFromLocalTime(LocalTime localTime){
27+
28+
public int getHourFromLocalTime(LocalTime localTime) {
2929
return localTime.getHour();
3030
}
31-
32-
public LocalTime getLocalTimeWithMinuteSetToValue(LocalTime localTime, int minute){
31+
32+
public LocalTime getLocalTimeWithMinuteSetToValue(LocalTime localTime, int minute) {
3333
return localTime.withMinute(minute);
3434
}
3535
}

core-java/src/main/java/com/baeldung/datetime/UsePeriod.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
import java.time.Period;
55

66
public class UsePeriod {
7-
8-
public LocalDate modifyDates(LocalDate localDate,Period period){
7+
8+
public LocalDate modifyDates(LocalDate localDate, Period period) {
99
return localDate.plus(period);
1010
}
11-
12-
public Period getDifferenceBetweenDates(LocalDate localDate1,LocalDate localDate2){
11+
12+
public Period getDifferenceBetweenDates(LocalDate localDate1, LocalDate localDate2) {
1313
return Period.between(localDate1, localDate2);
1414
}
1515
}

core-java/src/main/java/com/baeldung/datetime/UseToInstant.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
import java.util.Date;
77

88
public class UseToInstant {
9-
10-
public LocalDateTime convertDateToLocalDate(Date date){
9+
10+
public LocalDateTime convertDateToLocalDate(Date date) {
1111
LocalDateTime localDateTime = LocalDateTime.ofInstant(date.toInstant(), ZoneId.systemDefault());
1212
return localDateTime;
1313
}
14-
15-
public LocalDateTime convertDateToLocalDate(Calendar calendar){
14+
15+
public LocalDateTime convertDateToLocalDate(Calendar calendar) {
1616
LocalDateTime localDateTime = LocalDateTime.ofInstant(calendar.toInstant(), ZoneId.systemDefault());
1717
return localDateTime;
1818
}

core-java/src/main/java/com/baeldung/datetime/UseZonedDateTime.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import java.time.ZonedDateTime;
66

77
public class UseZonedDateTime {
8-
9-
public ZonedDateTime getZonedDateTime(LocalDateTime localDateTime,ZoneId zoneId){
8+
9+
public ZonedDateTime getZonedDateTime(LocalDateTime localDateTime, ZoneId zoneId) {
1010
ZonedDateTime zonedDateTime = ZonedDateTime.of(localDateTime, zoneId);
1111
return zonedDateTime;
1212
}

core-java/src/main/java/com/baeldung/enums/Pizza.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
public class Pizza {
99

10-
private static EnumSet<PizzaStatusEnum> deliveredPizzaStatuses =
11-
EnumSet.of(PizzaStatusEnum.DELIVERED);
10+
private static EnumSet<PizzaStatusEnum> deliveredPizzaStatuses = EnumSet.of(PizzaStatusEnum.DELIVERED);
1211

1312
private PizzaStatusEnum status;
1413

@@ -76,9 +75,7 @@ public static List<Pizza> getAllUndeliveredPizzas(List<Pizza> input) {
7675
}
7776

7877
public static EnumMap<PizzaStatusEnum, List<Pizza>> groupPizzaByStatus(List<Pizza> pzList) {
79-
return pzList.stream().collect(
80-
Collectors.groupingBy(Pizza::getStatus,
81-
() -> new EnumMap<>(PizzaStatusEnum.class), Collectors.toList()));
78+
return pzList.stream().collect(Collectors.groupingBy(Pizza::getStatus, () -> new EnumMap<>(PizzaStatusEnum.class), Collectors.toList()));
8279
}
8380

8481
public void deliver() {

core-java/src/main/java/com/baeldung/enums/PizzaDeliverySystemConfiguration.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.baeldung.enums;
22

3-
43
public enum PizzaDeliverySystemConfiguration {
54
INSTANCE;
65

core-java/src/main/java/com/baeldung/forkjoin/CustomRecursiveAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ protected void compute() {
3030

3131
private Collection<CustomRecursiveAction> createSubtasks() {
3232

33-
List<CustomRecursiveAction> subtasks =
34-
new ArrayList<>();
33+
List<CustomRecursiveAction> subtasks = new ArrayList<>();
3534

3635
String partOne = workLoad.substring(0, workLoad.length() / 2);
3736
String partTwo = workLoad.substring(workLoad.length() / 2, workLoad.length());

0 commit comments

Comments
 (0)