Class IdMapperFunctionFactory


  • public class IdMapperFunctionFactory
    extends Object
    Factory that creates functions for id mapping from PLANit ids to ids to be used for persistence. Based on the passed in IdMapper type functions will generate different ids when applied to nodes, link segments, etc.
    Author:
    markr
    • Constructor Detail

      • IdMapperFunctionFactory

        public IdMapperFunctionFactory()
    • Method Detail

      • createIdMappingFunction

        protected static <T extends ExternalIdAbleFunction<T,​String> createIdMappingFunction​(Class<T> clazz,
                                                                                                     IdMapperType idMapper)
        create a function that takes a a class that extends ExternalIdAble and generate the appropriate id based on the user configuration
        Type Parameters:
        T - ExternalIdable
        Parameters:
        clazz - to use
        idMapper - the type of mapping function to create
        Returns:
        function that generates node id's for MATSIM node output
      • createVertexIdMappingFunction

        public static Function<Vertex,​String> createVertexIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a node and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates node id's for MATSIM node output
      • createLinkIdMappingFunction

        public static Function<Link,​String> createLinkIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a link and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates mapped link id's for persistence
      • createLinkSegmentTypeIdMappingFunction

        public static Function<MacroscopicLinkSegmentType,​String> createLinkSegmentTypeIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a link segment type and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates mapped link segment type id's for persistence
      • createLinkSegmentIdMappingFunction

        public static Function<MacroscopicLinkSegment,​String> createLinkSegmentIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a link segment and (optional) id mapper and generates the appropriate link segment id based on the user configuration
        Parameters:
        idMapper - that generates mapped link segment id's for persistence
        Returns:
        created function
      • createModeIdMappingFunction

        public static Function<Mode,​String> createModeIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a mode and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates mapped mode id's for persistence
      • createConnectoidIdMappingFunction

        public static Function<Connectoid,​String> createConnectoidIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a connectoid and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates directed connectoi id's for node output
      • createZoneIdMappingFunction

        public static Function<Zone,​String> createZoneIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a zone and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates zone id's for zone output
      • createTransferZoneGroupIdMappingFunction

        public static Function<TransferZoneGroup,​String> createTransferZoneGroupIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a transfer zone group and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates transfer zone group id's for transfer zone group output
      • createTravellerTypeIdMappingFunction

        public static Function<TravellerType,​String> createTravellerTypeIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a traveller type and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates traveller type ids for traveller type output
      • createTimePeriodIdMappingFunction

        public static Function<TimePeriod,​String> createTimePeriodIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a traveller type and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates time period ids for time period output
      • createUserClassIdMappingFunction

        public static Function<UserClass,​String> createUserClassIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a user class and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates user class ids for user class output
      • createServiceLegIdMappingFunction

        public static Function<ServiceLeg,​String> createServiceLegIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a service leg and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates service leg ids for service leg output
      • createServiceLegSegmentIdMappingFunction

        public static Function<ServiceLegSegment,​String> createServiceLegSegmentIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a service leg segment and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates service leg segment ids for service leg segment output
      • createRoutedTripIdMappingFunction

        public static Function<RoutedTrip,​String> createRoutedTripIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a routed trip and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates routed trip ids
      • createRoutedTripDepartureIdMappingFunction

        public static Function<RoutedTripDeparture,​String> createRoutedTripDepartureIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a RoutedTripDeparture and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates RoutedTripDeparture ids
      • createRoutedServiceIdMappingFunction

        public static Function<RoutedService,​String> createRoutedServiceIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a RoutedService and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates RoutedService ids
      • createRoutedTripScheduleIdMappingFunction

        public static Function<RoutedTripSchedule,​String> createRoutedTripScheduleIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a RoutedTripSchedule and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates RoutedTripSchedule ids
      • createMacroscopicNetworkLayerIdMappingFunction

        public static Function<MacroscopicNetworkLayer,​String> createMacroscopicNetworkLayerIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a NetworkLayer and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates NetworkLayer ids
      • createMacroscopicNetworkIdMappingFunction

        public static Function<MacroscopicNetwork,​String> createMacroscopicNetworkIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a MacroscopicNetwork and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates MacroscopicNetwork ids
      • createServiceNetworkIdMappingFunction

        public static Function<ServiceNetwork,​String> createServiceNetworkIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a ServiceNetwork and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates ServiceNetwork ids
      • createRoutedServiceLayerIdMappingFunction

        public static Function<RoutedServicesLayer,​String> createRoutedServiceLayerIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a RoutedServicesLayer and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates RoutedServicesLayer ids
      • createServiceNetworkLayerIdMappingFunction

        public static Function<ServiceNetworkLayer,​String> createServiceNetworkLayerIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a ServiceNetworkLayer and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates ServiceNetworkLayer ids
      • createZoningIdMappingFunction

        public static Function<Zoning,​String> createZoningIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a Zoning and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates Zoning ids
      • createConnectoidEdgeIdMappingFunction

        public static Function<? extends ExternalIdAble,​String> createConnectoidEdgeIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a ConnectoidEdge and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates ConnectoidEdge ids
      • createConnectoidSegmentIdMappingFunction

        public static Function<? extends ExternalIdAble,​String> createConnectoidSegmentIdMappingFunction​(IdMapperType idMapper)
        create a function that takes a ConnectoidSegment and generates the appropriate id based on the user configuration
        Parameters:
        idMapper - the type of mapping function to create
        Returns:
        function that generates ConnectoidSegment ids