@Test public void parseSecondsSinceMidnight(){ SecondsSinceMidnight noon = (SecondsSinceMidnight)TypeUtil.parse(DataType.TIME_SECONDS, "12:00:00"); assertEquals(12L * 60 * 60, noon.longValue()); assertEquals("43200", TypeUtil.format(noon)); assertEquals(DataType.TIME_SECONDS, TypeUtil.getDataType(noon)); assertEquals(0L, countSecondsSinceMidnight("0:00:00")); assertEquals(100L, countSecondsSinceMidnight("0:01:40")); assertEquals(200L, countSecondsSinceMidnight("0:03:20")); assertEquals(1000L, countSecondsSinceMidnight("0:16:40")); assertEquals(86400L, countSecondsSinceMidnight("24:00:00")); assertEquals(86401L, countSecondsSinceMidnight("24:00:01")); assertEquals(100000L, countSecondsSinceMidnight("27:46:40")); assertEquals(19410L, countSecondsSinceMidnight("05:23:30")); assertEquals(-10L, countSecondsSinceMidnight("-0:00:10")); assertEquals(-100L, countSecondsSinceMidnight("-0:01:40")); assertEquals(-1000L, countSecondsSinceMidnight("-0:16:40")); assertEquals(-10000L, countSecondsSinceMidnight("-2:46:40")); assertEquals(-100000L, countSecondsSinceMidnight("-27:46:40")); }
static private SecondsSinceMidnight parseSecondsSinceMidnight(String value){ try { return SecondsSinceMidnight.parse(value); } catch(DateTimeException dte){ throw new IllegalArgumentException(value, dte); } }
TypeUtil { static private SecondsSinceMidnight parseSecondsSinceMidnight(String value){ try { return SecondsSinceMidnight.parse(value); } catch(DateTimeException dte){ throw new IllegalArgumentException(value, dte); } } }
TypeUtil { static private SecondsSinceMidnight parseSecondsSinceMidnight(String value){ try { return SecondsSinceMidnight.parse(value); } catch(DateTimeException dte){ throw new IllegalArgumentException(value, dte); } } private  TypeUtil(); }
TypeUtil { static private SecondsSinceMidnight parseSecondsSinceMidnight(String value){ try { return SecondsSinceMidnight.parse(value); } catch(DateTimeException dte){ throw new IllegalArgumentException(value, dte); } } private  TypeUtil(); static String format(Object value); static Object parseOrCast(DataType dataType, Object value); static Object parse(DataType dataType, String value); static DaysSinceDate parseDaysSinceDate(LocalDate epoch, String value); static boolean equals(DataType dataType, Object value, Object referenceValue); static DataType getDataType(Object value); static DataType getDataType(Collection<?> values); static DataType getCommonDataType(DataType left, DataType right); static OpType getOpType(DataType dataType); static Object cast(DataType dataType, Object value); static V cast(Class<? extends V> clazz, Object value); static DataType getConstantDataType(Object value); static DataType getConstantDataType(String value); }
TypeUtil { static private SecondsSinceMidnight parseSecondsSinceMidnight(String value){ try { return SecondsSinceMidnight.parse(value); } catch(DateTimeException dte){ throw new IllegalArgumentException(value, dte); } } private  TypeUtil(); static String format(Object value); static Object parseOrCast(DataType dataType, Object value); static Object parse(DataType dataType, String value); static DaysSinceDate parseDaysSinceDate(LocalDate epoch, String value); static boolean equals(DataType dataType, Object value, Object referenceValue); static DataType getDataType(Object value); static DataType getDataType(Collection<?> values); static DataType getCommonDataType(DataType left, DataType right); static OpType getOpType(DataType dataType); static Object cast(DataType dataType, Object value); static V cast(Class<? extends V> clazz, Object value); static DataType getConstantDataType(Object value); static DataType getConstantDataType(String value);  }