upgraded to jackson2
This commit is contained in:
@ -29,10 +29,10 @@ public class ApiKeyObject {
|
||||
@Expose
|
||||
private String userName;
|
||||
@Expose
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, locale="en_US", timezone = "UTC", pattern="yyyy-MM-dd'T'HH:mm:ss:SSS'Z[UTC]'")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, locale="en_US", timezone = "UTC", pattern="yyyy-MM-dd'T'HH:mm:ss'Z'")
|
||||
private Date issuedOn;
|
||||
@Expose
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, locale="en_US", timezone = "UTC", pattern="yyyy-MM-dd'T'HH:mm:ss:SSS'Z[UTC]'")
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, locale="en_US", timezone = "UTC", pattern="yyyy-MM-dd'T'HH:mm:ss'Z]'")
|
||||
private Date expiresOn;
|
||||
@Expose
|
||||
private String authToken;
|
||||
|
||||
@ -0,0 +1,30 @@
|
||||
package de.muehlencord.shared.account.dao;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.fasterxml.jackson.databind.SerializationFeature;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author joern.muehlencord
|
||||
*/
|
||||
public abstract class JacksonConfig {
|
||||
|
||||
private static ObjectMapper objectMapper = null;
|
||||
|
||||
private JacksonConfig() {
|
||||
// hide public constructor for static only class
|
||||
}
|
||||
|
||||
public static ObjectMapper getInstance() {
|
||||
if (objectMapper == null) {
|
||||
objectMapper = new ObjectMapper();
|
||||
objectMapper.setDateFormat(new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"));
|
||||
objectMapper.configure(SerializationFeature.INDENT_OUTPUT, true);
|
||||
objectMapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
|
||||
objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
|
||||
}
|
||||
return objectMapper;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user