com.targomo.client.api.json.TravelOptionsSerializer 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
Java client library for easy usage of Targomo web services.
The newest version!
package com.targomo.client.api.json;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
import com.targomo.client.api.TravelOptions;
import com.targomo.client.api.exception.TargomoClientException;
import com.targomo.client.api.request.config.RequestConfigurator;
import java.io.IOException;
public class TravelOptionsSerializer extends StdSerializer {
public TravelOptionsSerializer() {
super((Class)null);
}
@Override
public void serialize(TravelOptions travelOptions, JsonGenerator gen, SerializerProvider serializers) throws IOException {
try {
gen.writeRawValue(RequestConfigurator.getConfig(travelOptions));
} catch (TargomoClientException e) {
throw new IOException("Failed to serialize TravelOptions object.", e);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy