mirror of
https://github.com/fabioformosa/quartz-manager.git
synced 2026-05-14 22:00:30 +09:00
#78 fixed some smells
This commit is contained in:
@@ -2,6 +2,9 @@ package it.fabioformosa.quartzmanager.api.common.config;
|
||||
|
||||
public class QuartzManagerPaths {
|
||||
|
||||
private QuartzManagerPaths(){
|
||||
}
|
||||
|
||||
public static final String QUARTZ_MANAGER_BASE_CONTEXT_PATH = "/quartz-manager";
|
||||
public static final String WEBJAR_PATH = "/quartz-manager-ui";
|
||||
|
||||
|
||||
@@ -8,15 +8,18 @@ import java.util.Date;
|
||||
|
||||
public class DateUtils {
|
||||
|
||||
static public Date fromLocalDateTimeToDate(LocalDateTime localDateTime){
|
||||
private DateUtils(){
|
||||
}
|
||||
|
||||
public static Date fromLocalDateTimeToDate(LocalDateTime localDateTime){
|
||||
return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant().truncatedTo(ChronoUnit.MILLIS));
|
||||
}
|
||||
|
||||
static public LocalDateTime fromDateToLocalDateTime(Date date) {
|
||||
public static LocalDateTime fromDateToLocalDateTime(Date date) {
|
||||
return date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime().truncatedTo(ChronoUnit.MILLIS);
|
||||
}
|
||||
|
||||
static public Date addHoursToNow(long hours){
|
||||
public static Date addHoursToNow(long hours){
|
||||
return DateUtils.fromLocalDateTimeToDate(LocalDateTime.now().plus(Duration.ofHours(hours)));
|
||||
}
|
||||
|
||||
|
||||
@@ -16,11 +16,11 @@ public class Try<R> {
|
||||
return success;
|
||||
}
|
||||
|
||||
public static <R> Try success(R r){
|
||||
public static <R> Try<R> success(R r){
|
||||
return new Try<>(null, r);
|
||||
}
|
||||
|
||||
public static <ExceptionType> Try failure(Throwable e){
|
||||
public static <R> Try<R> failure(Throwable e){
|
||||
return new Try<>(e, null);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user