Skip to content

Commit

Permalink
refactor: move booking classes into transit.model.timetable.booking
Browse files Browse the repository at this point in the history
  • Loading branch information
t2gran committed Apr 29, 2024
1 parent c69494a commit ea8ce4c
Show file tree
Hide file tree
Showing 41 changed files with 52 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
import javax.annotation.Nullable;
import org.opentripplanner.ext.flex.trip.FlexTrip;
import org.opentripplanner.framework.tostring.ToStringBuilder;
import org.opentripplanner.model.booking.RoutingBookingInfo;
import org.opentripplanner.street.search.state.State;
import org.opentripplanner.transit.model.site.RegularStop;
import org.opentripplanner.transit.model.timetable.booking.RoutingBookingInfo;

public final class FlexAccessEgress {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.opentripplanner.framework.lang.DoubleUtils;
import org.opentripplanner.framework.tostring.ToStringBuilder;
import org.opentripplanner.model.PickDrop;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.model.fare.FareProductUse;
import org.opentripplanner.model.plan.Leg;
import org.opentripplanner.model.plan.LegTime;
Expand All @@ -28,6 +27,7 @@
import org.opentripplanner.transit.model.organization.Agency;
import org.opentripplanner.transit.model.organization.Operator;
import org.opentripplanner.transit.model.timetable.Trip;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

/**
* One leg of a trip -- that is, a temporally continuous piece of the journey that takes place on a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
import org.opentripplanner.ext.flex.template.FlexEgressTemplate;
import org.opentripplanner.model.PickDrop;
import org.opentripplanner.model.StopTime;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.routing.graphfinder.NearbyStop;
import org.opentripplanner.standalone.config.sandbox.FlexConfig;
import org.opentripplanner.transit.model.framework.AbstractTransitEntity;
import org.opentripplanner.transit.model.site.AreaStop;
import org.opentripplanner.transit.model.site.GroupStop;
import org.opentripplanner.transit.model.site.StopLocation;
import org.opentripplanner.transit.model.timetable.Trip;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

/**
* This class represents the different variations of what is considered flexible transit, and its
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
import org.opentripplanner.ext.flex.template.FlexEgressTemplate;
import org.opentripplanner.model.PickDrop;
import org.opentripplanner.model.StopTime;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.routing.graphfinder.NearbyStop;
import org.opentripplanner.standalone.config.sandbox.FlexConfig;
import org.opentripplanner.transit.model.framework.FeedScopedId;
import org.opentripplanner.transit.model.framework.TransitBuilder;
import org.opentripplanner.transit.model.site.GroupStop;
import org.opentripplanner.transit.model.site.RegularStop;
import org.opentripplanner.transit.model.site.StopLocation;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

/**
* A scheduled deviated trip is similar to a regular scheduled trip, except that it contains stop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
import org.opentripplanner.framework.lang.IntRange;
import org.opentripplanner.model.PickDrop;
import org.opentripplanner.model.StopTime;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.routing.graphfinder.NearbyStop;
import org.opentripplanner.standalone.config.sandbox.FlexConfig;
import org.opentripplanner.transit.model.framework.FeedScopedId;
import org.opentripplanner.transit.model.framework.TransitBuilder;
import org.opentripplanner.transit.model.site.GroupStop;
import org.opentripplanner.transit.model.site.StopLocation;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

/**
* This type of FlexTrip is used when a taxi-type service is modeled, which operates in any number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.opentripplanner.ext.restapi.mapping;

import org.opentripplanner.ext.restapi.model.ApiBookingInfo;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

public class BookingInfoMapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.EnumSet;
import java.util.Set;
import java.util.stream.Collectors;
import org.opentripplanner.model.booking.BookingMethod;
import org.opentripplanner.transit.model.timetable.booking.BookingMethod;

public class BookingMethodMapper {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.opentripplanner.ext.restapi.mapping;

import org.opentripplanner.ext.restapi.model.ApiBookingTime;
import org.opentripplanner.model.booking.BookingTime;
import org.opentripplanner.transit.model.timetable.booking.BookingTime;

public class BookingTimeMapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import graphql.schema.DataFetcher;
import graphql.schema.DataFetchingEnvironment;
import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.model.booking.BookingTime;
import org.opentripplanner.transit.model.organization.ContactInfo;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;
import org.opentripplanner.transit.model.timetable.booking.BookingTime;

public class BookingInfoImpl implements GraphQLDataFetchers.GraphQLBookingInfo {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import graphql.schema.DataFetchingEnvironment;
import java.time.format.DateTimeFormatter;
import org.opentripplanner.apis.gtfs.generated.GraphQLDataFetchers;
import org.opentripplanner.model.booking.BookingTime;
import org.opentripplanner.transit.model.timetable.booking.BookingTime;

public class BookingTimeImpl implements GraphQLDataFetchers.GraphQLBookingTime {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.opentripplanner.ext.ridehailing.model.RideHailingLeg;
import org.opentripplanner.framework.graphql.GraphQLUtils;
import org.opentripplanner.model.PickDrop;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.model.fare.FareProductUse;
import org.opentripplanner.model.plan.Leg;
import org.opentripplanner.model.plan.LegTime;
Expand All @@ -30,6 +29,7 @@
import org.opentripplanner.transit.model.network.Route;
import org.opentripplanner.transit.model.organization.Agency;
import org.opentripplanner.transit.model.timetable.Trip;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

public class LegImpl implements GraphQLDataFetchers.GraphQLLeg {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import org.opentripplanner.model.StopTimesInPattern;
import org.opentripplanner.model.SystemNotice;
import org.opentripplanner.model.TripTimeOnDate;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.model.booking.BookingTime;
import org.opentripplanner.model.calendar.openinghours.OHCalendar;
import org.opentripplanner.model.fare.FareMedium;
import org.opentripplanner.model.fare.FareProduct;
Expand Down Expand Up @@ -63,6 +61,8 @@
import org.opentripplanner.transit.model.network.TripPattern;
import org.opentripplanner.transit.model.organization.Agency;
import org.opentripplanner.transit.model.timetable.Trip;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;
import org.opentripplanner.transit.model.timetable.booking.BookingTime;

public class GraphQLDataFetchers {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ config:
RentalVehicle: org.opentripplanner.service.vehiclerental.model.VehicleRentalVehicle#VehicleRentalVehicle
VehicleRentalUris: org.opentripplanner.service.vehiclerental.model.VehicleRentalStationUris#VehicleRentalStationUris
BikesAllowed: org.opentripplanner.apis.gtfs.generated.GraphQLTypes.GraphQLBikesAllowed#GraphQLBikesAllowed
BookingInfo: org.opentripplanner.model.booking.BookingInfo
BookingTime: org.opentripplanner.model.booking.BookingTime
BookingInfo: org.opentripplanner.transit.model.network.booking.BookingInfo
BookingTime: org.opentripplanner.transit.model.network.booking.BookingTime
CarPark: org.opentripplanner.routing.vehicle_parking.VehicleParking#VehicleParking
ContactInfo: org.opentripplanner.transit.model.organization.ContactInfo
Cluster: Object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import java.util.List;
import java.util.function.Function;
import org.opentripplanner.framework.doc.DocumentedEnum;
import org.opentripplanner.model.booking.BookingMethod;
import org.opentripplanner.model.plan.AbsoluteDirection;
import org.opentripplanner.model.plan.RelativeDirection;
import org.opentripplanner.model.plan.VertexType;
Expand All @@ -27,6 +26,7 @@
import org.opentripplanner.transit.model.timetable.OccupancyStatus;
import org.opentripplanner.transit.model.timetable.RealTimeState;
import org.opentripplanner.transit.model.timetable.TripAlteration;
import org.opentripplanner.transit.model.timetable.booking.BookingMethod;

public class EnumTypes {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import graphql.schema.GraphQLOutputType;
import org.opentripplanner.apis.transmodel.model.EnumTypes;
import org.opentripplanner.apis.transmodel.support.GqlUtil;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.model.booking.BookingTime;
import org.opentripplanner.transit.model.organization.ContactInfo;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;
import org.opentripplanner.transit.model.timetable.booking.BookingTime;

public class BookingArrangementType {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
import java.util.Map;
import org.onebusaway.gtfs.model.AgencyAndId;
import org.onebusaway.gtfs.model.BookingRule;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.model.booking.BookingMethod;
import org.opentripplanner.model.booking.BookingTime;
import org.opentripplanner.transit.model.organization.ContactInfo;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;
import org.opentripplanner.transit.model.timetable.booking.BookingMethod;
import org.opentripplanner.transit.model.timetable.booking.BookingTime;

/** Responsible for mapping GTFS BookingRule into the OTP model. */
class BookingRuleMapper {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/opentripplanner/model/StopTime.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import java.util.List;
import org.opentripplanner.framework.i18n.I18NString;
import org.opentripplanner.framework.time.TimeUtils;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.transit.model.site.StopLocation;
import org.opentripplanner.transit.model.timetable.StopTimeKey;
import org.opentripplanner.transit.model.timetable.Trip;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

/**
* This class is TEMPORALLY used during mapping of GTFS and Netex into the internal Model, it is not
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
import java.util.Comparator;
import java.util.List;
import org.opentripplanner.framework.i18n.I18NString;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.transit.model.network.TripPattern;
import org.opentripplanner.transit.model.site.StopLocation;
import org.opentripplanner.transit.model.timetable.OccupancyStatus;
import org.opentripplanner.transit.model.timetable.RealTimeState;
import org.opentripplanner.transit.model.timetable.StopTimeKey;
import org.opentripplanner.transit.model.timetable.Trip;
import org.opentripplanner.transit.model.timetable.TripTimes;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/opentripplanner/model/plan/Leg.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.opentripplanner.framework.i18n.I18NString;
import org.opentripplanner.framework.lang.Sandbox;
import org.opentripplanner.model.PickDrop;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.model.fare.FareProductUse;
import org.opentripplanner.model.plan.legreference.LegReference;
import org.opentripplanner.model.transfer.ConstrainedTransfer;
Expand All @@ -25,6 +24,7 @@
import org.opentripplanner.transit.model.site.FareZone;
import org.opentripplanner.transit.model.timetable.Trip;
import org.opentripplanner.transit.model.timetable.TripOnServiceDate;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

/**
* One leg of a trip -- that is, a temporally continuous piece of the journey that takes place on a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.opentripplanner.framework.time.ServiceDateUtils;
import org.opentripplanner.framework.tostring.ToStringBuilder;
import org.opentripplanner.model.PickDrop;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.model.fare.FareProductUse;
import org.opentripplanner.model.plan.legreference.LegReference;
import org.opentripplanner.model.plan.legreference.ScheduledTransitLegReference;
Expand All @@ -38,6 +37,7 @@
import org.opentripplanner.transit.model.timetable.Trip;
import org.opentripplanner.transit.model.timetable.TripOnServiceDate;
import org.opentripplanner.transit.model.timetable.TripTimes;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

/**
* One leg of a trip -- that is, a temporally continuous piece of the journey that takes place on a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.model.booking.BookingMethod;
import org.opentripplanner.model.booking.BookingTime;
import org.opentripplanner.transit.model.organization.ContactInfo;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;
import org.opentripplanner.transit.model.timetable.booking.BookingMethod;
import org.opentripplanner.transit.model.timetable.booking.BookingTime;
import org.rutebanken.netex.model.BookingArrangementsStructure;
import org.rutebanken.netex.model.BookingMethodEnumeration;
import org.rutebanken.netex.model.ContactStructure;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.opentripplanner.netex.mapping;

import org.opentripplanner.model.booking.BookingMethod;
import org.opentripplanner.transit.model.timetable.booking.BookingMethod;
import org.rutebanken.netex.model.BookingMethodEnumeration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.opentripplanner.framework.i18n.NonLocalizedString;
import org.opentripplanner.graph_builder.issue.api.DataImportIssueStore;
import org.opentripplanner.model.StopTime;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.netex.index.api.ReadOnlyHierarchicalMap;
import org.opentripplanner.netex.index.api.ReadOnlyHierarchicalMapById;
import org.opentripplanner.netex.mapping.support.FeedScopedIdFactory;
Expand All @@ -27,6 +26,7 @@
import org.opentripplanner.transit.model.site.RegularStop;
import org.opentripplanner.transit.model.site.StopLocation;
import org.opentripplanner.transit.model.timetable.Trip;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;
import org.rutebanken.netex.model.DestinationDisplay;
import org.rutebanken.netex.model.DestinationDisplay_VersionStructure;
import org.rutebanken.netex.model.FlexibleLine;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

import javax.annotation.Nullable;
import org.opentripplanner.framework.model.TimeAndCost;
import org.opentripplanner.model.booking.RoutingBookingInfo;
import org.opentripplanner.street.search.state.State;
import org.opentripplanner.transit.model.timetable.booking.RoutingBookingInfo;

public class BookingTimeAccessEgress implements RoutingAccessEgress {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import org.opentripplanner.ext.flex.FlexAccessEgress;
import org.opentripplanner.framework.model.TimeAndCost;
import org.opentripplanner.model.StopTime;
import org.opentripplanner.model.booking.RoutingBookingInfo;
import org.opentripplanner.raptor.api.model.RaptorConstants;
import org.opentripplanner.transit.model.timetable.booking.RoutingBookingInfo;

/**
* This class is used to adapt the FlexAccessEgress into a time-dependent multi-leg DefaultAccessEgress.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import java.util.Optional;
import org.opentripplanner.framework.model.TimeAndCost;
import org.opentripplanner.model.booking.RoutingBookingInfo;
import org.opentripplanner.raptor.api.model.RaptorAccessEgress;
import org.opentripplanner.street.search.state.State;
import org.opentripplanner.transit.model.timetable.booking.RoutingBookingInfo;

/**
* Encapsulate information about an access or egress path. This interface extends
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import java.util.function.IntUnaryOperator;
import javax.annotation.Nullable;
import org.opentripplanner.framework.i18n.I18NString;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.transit.model.basic.Accessibility;
import org.opentripplanner.transit.model.framework.DataValidationException;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

/**
* A TripTimes represents the arrival and departure times for a single trip in an Timetable. It is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
import org.opentripplanner.framework.lang.IntUtils;
import org.opentripplanner.framework.time.DurationUtils;
import org.opentripplanner.framework.time.TimeUtils;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.transit.model.basic.Accessibility;
import org.opentripplanner.transit.model.framework.DataValidationException;
import org.opentripplanner.transit.model.framework.Deduplicator;
import org.opentripplanner.transit.model.framework.DeduplicatorService;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

/**
* Regular/planed/scheduled read-only version of {@link TripTimes}. The set of static
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import javax.annotation.Nullable;
import org.opentripplanner.framework.i18n.I18NString;
import org.opentripplanner.framework.time.TimeUtils;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.transit.model.framework.DeduplicatorService;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

public class ScheduledTripTimesBuilder {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import java.util.List;
import org.opentripplanner.framework.i18n.I18NString;
import org.opentripplanner.model.StopTime;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.transit.model.framework.DeduplicatorService;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

class StopTimeToScheduledTripTimesMapper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import java.util.OptionalInt;
import javax.annotation.Nullable;
import org.opentripplanner.framework.i18n.I18NString;
import org.opentripplanner.model.booking.BookingInfo;
import org.opentripplanner.transit.model.basic.Accessibility;
import org.opentripplanner.transit.model.timetable.booking.BookingInfo;

/**
* A TripTimes represents the arrival and departure times for a single trip in a timetable. It is
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.opentripplanner.model.booking;
package org.opentripplanner.transit.model.timetable.booking;

import java.io.Serializable;
import java.time.Duration;
Expand Down
Loading

0 comments on commit ea8ce4c

Please sign in to comment.