spring-boot-realworld-examp.../src/main/java/io/spring/application/DateTimeCursor.java

24 lines
512 B
Java
Raw Normal View History

2021-03-23 14:54:04 +07:00
package io.spring.application;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
public class DateTimeCursor extends PageCursor<DateTime> {
public DateTimeCursor(DateTime data) {
super(data);
}
@Override
public String toString() {
return String.valueOf(getData().getMillis());
}
public static DateTime parse(String cursor) {
if (cursor == null) {
return null;
}
return new DateTime().withMillis(Long.parseLong(cursor)).withZone(DateTimeZone.UTC);
}
}