@Test public void testEncodeTimestamp() { Date tests[] = { new Date(Long.parseLong("1193046000")), new Date(Long.parseLong("1465980719000")), new Date(Long.parseLong("2882400009000")), new Date(1490019720000L), }; String[] expected = { "123456", "5761172f", "abcdef09", "58cfe588" }; for (int i = 0; i < tests.length; i++) { Assert.assertEquals(expected[i], Timestamp.encodeTimeCookie(tests[i])); } }
public static String encodeTimeCookie(Date date) { return Long.toHexString(date.getTime() / 1000); }
Timestamp { public static String encodeTimeCookie(Date date) { return Long.toHexString(date.getTime() / 1000); } }
Timestamp { public static String encodeTimeCookie(Date date) { return Long.toHexString(date.getTime() / 1000); } private  Timestamp(); }
Timestamp { public static String encodeTimeCookie(Date date) { return Long.toHexString(date.getTime() / 1000); } private  Timestamp(); static Date decodeTimeCookie(String cookie); static String encodeTimeCookie(Date date); }
Timestamp { public static String encodeTimeCookie(Date date) { return Long.toHexString(date.getTime() / 1000); } private  Timestamp(); static Date decodeTimeCookie(String cookie); static String encodeTimeCookie(Date date);  }