org.opentripplanner.api.json.FeedScopedIdKeyDeserializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of otp Show documentation
Show all versions of otp Show documentation
The OpenTripPlanner multimodal journey planning system
package org.opentripplanner.api.json;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.KeyDeserializer;
import org.opentripplanner.model.FeedScopedId;
import java.io.IOException;
// Map key (de)serializers are always separate from value ones, because they must be strings.
public class FeedScopedIdKeyDeserializer extends KeyDeserializer {
public static final String SEPARATOR = ":";
@Override
public Object deserializeKey(String key, DeserializationContext ctxt) throws IOException {
String[] parts = key.split(SEPARATOR, 2);
return new FeedScopedId(parts[0], parts[1]);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy