infrastructure improvements

This commit is contained in:
Michał Michaluk
2017-12-07 19:59:22 +01:00
parent cc1376fa53
commit 075b625b98
33 changed files with 265 additions and 122 deletions

View File

@@ -11,10 +11,6 @@ public class Demand {
AtDayStart, Every3hours, TillDayEnd, Twice
}
public static Demand nothingDemanded() {
return of(0);
}
public static Demand of(long level) {
return new Demand(level, Schema.TillDayEnd);
}
@@ -22,4 +18,14 @@ public class Demand {
public static Demand of(long level, Schema schema) {
return new Demand(level, schema);
}
public static Demand nothingDemanded() {
return of(0);
}
public static Demand ofNullable(Long level, Schema schema) {
return level == null || schema == null
? nothingDemanded()
: of(level, schema);
}
}