
org.opentripplanner.ext.restapi.serialization.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
The newest version!
package org.opentripplanner.ext.restapi.serialization;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.KeyDeserializer;
import java.io.IOException;
import org.opentripplanner.transit.model.framework.FeedScopedId;
// 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