Package org.goplanit.service.routed
Class RoutedTripDepartureImpl
- java.lang.Object
-
- org.goplanit.utils.id.IdAbleImpl
-
- org.goplanit.utils.id.ExternalIdAbleImpl
-
- org.goplanit.service.routed.RoutedTripDepartureImpl
-
- All Implemented Interfaces:
Comparable<IdAble>
,ExternalIdAble
,IdAble
,ManagedId
,RoutedTripDeparture
public class RoutedTripDepartureImpl extends ExternalIdAbleImpl implements RoutedTripDeparture
An representation of a departure within a routed trip- Author:
- markr
-
-
Field Summary
-
Fields inherited from interface org.goplanit.utils.service.routed.RoutedTripDeparture
ROUTED_TRIP_DEPARTURE_ID_CLASS
-
-
Constructor Summary
Constructors Constructor Description RoutedTripDepartureImpl(RoutedTripDepartureImpl routedTripDeparture, boolean deepCopy)
Copy constructorRoutedTripDepartureImpl(IdGroupingToken tokenId, ExtendedLocalTime departureTime)
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description RoutedTripDepartureImpl
deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call.void
departEarlier(LocalTime departureTimeDecrease)
Depart earlier by the given amountvoid
departLater(LocalTime departureTimeIncrease)
Depart later by the given amountprotected static long
generateId(IdGroupingToken tokenId)
Generate id for instances of this class based on the token and class identifierExtendedLocalTime
getDepartureTime()
Departure time of the trip this instance is stored onClass<RoutedTripDeparture>
getIdClass()
Each managed id class is expected to generate its ids based on its class signature.long
recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable idRoutedTripDepartureImpl
shallowClone()
Create a shallow copy of this entityString
toString()
-
Methods inherited from class org.goplanit.utils.id.ExternalIdAbleImpl
getExternalId, getXmlId, setExternalId, setXmlId
-
Methods inherited from class org.goplanit.utils.id.IdAbleImpl
equals, generateAndSetId, generateId, getId, hashCode, setId
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.goplanit.utils.id.ExternalIdAble
appendExternalId, appendExternalId, getExternalId, getIdsAsString, getSplitExternalId, getSplitExternalId, getXmlId, hasExternalId, hasXmlId, setExternalId, setXmlId, setXmlId
-
Methods inherited from interface org.goplanit.utils.id.IdAble
compareTo, getId, idEquals, idHashCode
-
Methods inherited from interface org.goplanit.utils.id.ManagedId
resetChildManagedIdEntities
-
-
-
-
Constructor Detail
-
RoutedTripDepartureImpl
public RoutedTripDepartureImpl(IdGroupingToken tokenId, ExtendedLocalTime departureTime)
Constructor- Parameters:
tokenId
- to use for id generationdepartureTime
- to use
-
RoutedTripDepartureImpl
public RoutedTripDepartureImpl(RoutedTripDepartureImpl routedTripDeparture, boolean deepCopy)
Copy constructor- Parameters:
routedTripDeparture
- to copydeepCopy
- when true, create a deep copy, shallow copy otherwise
-
-
Method Detail
-
generateId
protected static long generateId(IdGroupingToken tokenId)
Generate id for instances of this class based on the token and class identifier- Parameters:
tokenId
- to use- Returns:
- generated id
-
getIdClass
public Class<RoutedTripDeparture> getIdClass()
Each managed id class is expected to generate its ids based on its class signature. To be able to generate the correct id the class used for id generation is to be provided via this method call.- Specified by:
getIdClass
in interfaceManagedId
- Specified by:
getIdClass
in interfaceRoutedTripDeparture
- Returns:
- idClass to use for generating ids for instances of this idable derived class
-
recreateManagedIds
public long recreateManagedIds(IdGroupingToken tokenId)
recreate the internal id(s) and set them including the Idable id- Specified by:
recreateManagedIds
in interfaceManagedId
- Parameters:
tokenId
- to use (may be null in case managed id entity does not rely on token to recreate its managed id(s))- Returns:
- the updated internal id
-
getDepartureTime
public ExtendedLocalTime getDepartureTime()
Departure time of the trip this instance is stored on- Specified by:
getDepartureTime
in interfaceRoutedTripDeparture
- Returns:
- departure time
-
shallowClone
public RoutedTripDepartureImpl shallowClone()
Create a shallow copy of this entity- Specified by:
shallowClone
in interfaceIdAble
- Specified by:
shallowClone
in interfaceRoutedTripDeparture
- Overrides:
shallowClone
in classExternalIdAbleImpl
- Returns:
- shallow copy of entity
-
deepClone
public RoutedTripDepartureImpl deepClone()
An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code- Specified by:
deepClone
in interfaceIdAble
- Specified by:
deepClone
in interfaceRoutedTripDeparture
- Overrides:
deepClone
in classExternalIdAbleImpl
- Returns:
- deep copy of entity
-
departLater
public void departLater(LocalTime departureTimeIncrease)
Depart later by the given amount- Specified by:
departLater
in interfaceRoutedTripDeparture
- Parameters:
departureTimeIncrease
- to apply
-
departEarlier
public void departEarlier(LocalTime departureTimeDecrease)
Depart earlier by the given amount- Specified by:
departEarlier
in interfaceRoutedTripDeparture
- Parameters:
departureTimeDecrease
- to apply
-
-