Skip to content

Commit 3a92005

Browse files
author
jsabin
committed
Fix for issue kairosdb#51 TimeValidator Wording "Start time cannot be later than the ending time".
1 parent 3937f43 commit 3a92005

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/main/java/org/kairosdb/client/builder/TimeValidator.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,32 @@
2222
*/
2323
public class TimeValidator
2424
{
25+
private static final String START_TIME_EARLIER = "Start time must be earlier than the ending time\" (note the subtle difference";
26+
2527
private TimeValidator()
2628
{
2729
}
2830

2931
public static void validateEndTimeLaterThanStartTime(long startTime, long endTime)
3032
{
31-
checkState(endTime > startTime, "Start time cannot be later than the ending time");
33+
checkState(endTime > startTime, START_TIME_EARLIER);
3234
}
3335

3436
public static void validateEndTimeLaterThanStartTime(RelativeTime startTime, RelativeTime endTime)
3537
{
3638
long now = System.currentTimeMillis();
37-
checkState(startTime.getTimeRelativeTo(now) < endTime.getTimeRelativeTo(now), "Start time cannot be later than the ending time");
39+
checkState(startTime.getTimeRelativeTo(now) < endTime.getTimeRelativeTo(now), START_TIME_EARLIER);
3840
}
3941

4042
public static void validateEndTimeLaterThanStartTime(long startTime, RelativeTime endTime)
4143
{
4244
long now = System.currentTimeMillis();
43-
checkState(startTime < endTime.getTimeRelativeTo(now), "Start time cannot be later than the ending time");
45+
checkState(startTime < endTime.getTimeRelativeTo(now), START_TIME_EARLIER);
4446
}
4547

4648
public static void validateEndTimeLaterThanStartTime(RelativeTime startTime, long endTime)
4749
{
4850
long now = System.currentTimeMillis();
49-
checkState(startTime.getTimeRelativeTo(now) < endTime, "Start time cannot be later than the ending time");
51+
checkState(startTime.getTimeRelativeTo(now) < endTime, START_TIME_EARLIER);
5052
}
5153
}

0 commit comments

Comments
 (0)