com.urbanairship.api.schedule.parse.ScheduleSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-client Show documentation
Show all versions of java-client Show documentation
The Urban Airship Java client library
/*
* Copyright 2013 Urban Airship and Contributors
*/
package com.urbanairship.api.schedule.parse;
import com.urbanairship.api.common.parse.DateFormats;
import com.urbanairship.api.schedule.model.Schedule;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;
import java.io.IOException;
public class ScheduleSerializer extends JsonSerializer {
public static final ScheduleSerializer INSTANCE = new ScheduleSerializer();
private ScheduleSerializer() { }
@Override
public void serialize(Schedule value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
jgen.writeStartObject();
jgen.writeStringField("scheduled_time", DateFormats.DATE_FORMATTER.print(value.getScheduledTimestamp()));
jgen.writeEndObject();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy