spring security LocalDateTimeAdapter 源码
spring security LocalDateTimeAdapter 代码
文件路径:/buildSrc/src/main/java/org/springframework/gradle/github/milestones/LocalDateTimeAdapter.java
package org.springframework.gradle.github.milestones;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import com.google.gson.TypeAdapter;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
/**
* @author Steve Riesenberg
*/
class LocalDateTimeAdapter extends TypeAdapter<LocalDateTime> {
@Override
public void write(JsonWriter jsonWriter, LocalDateTime localDateTime) throws IOException {
jsonWriter.value(localDateTime.atOffset(ZoneOffset.UTC).format(DateTimeFormatter.ISO_ZONED_DATE_TIME));
}
@Override
public LocalDateTime read(JsonReader jsonReader) throws IOException {
return LocalDateTime.parse(jsonReader.nextString(), DateTimeFormatter.ISO_ZONED_DATE_TIME);
}
}
相关信息
相关文章
spring security GitHubMilestoneApi 源码
spring security GitHubMilestoneHasNoOpenIssuesTask 源码
spring security GitHubMilestoneNextReleaseTask 源码
spring security GitHubMilestoneNextVersionDueTodayTask 源码
spring security GitHubMilestonePlugin 源码
spring security LocalDateAdapter 源码
spring security NextVersionYml 源码
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦