All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.api.adapters.AgencyAndIdAdapter Maven / Gradle / Ivy

package org.opentripplanner.api.adapters;

import javax.xml.bind.annotation.adapters.XmlAdapter;

import org.opentripplanner.model.FeedScopedId;

public class AgencyAndIdAdapter extends XmlAdapter {

    @Override
    public FeedScopedId unmarshal(AgencyAndIdType arg) throws Exception {
        if (arg == null) {
            return null;
        }
        return new FeedScopedId(arg.agency, arg.id);
    }

    @Override
    public AgencyAndIdType marshal(FeedScopedId arg) throws Exception {
        if (arg == null) {
            return null;
        }
        return new AgencyAndIdType(arg.getAgencyId(), arg.getId());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy