Package com.cta4j.bus.detour.model
Record Class Detour
java.lang.Object
java.lang.Record
com.cta4j.bus.detour.model.Detour
- Record Components:
id- the unique identifier of this detourversion- the version of this detouractive- whether this detour is currently activedescription- the human-readable description of this detourrouteDirections- the routes and directions affected by this detourstartTime- the time at which this detour beginsendTime- the time at which this detour endsdataFeed- the identifier for the data feed that supplied this detour, ornullif not available
@NullMarked
public record Detour(String id, String version, boolean active, String description, List<DetourRouteDirection> routeDirections, Instant startTime, Instant endTime, @Nullable String dataFeed)
extends Record
Represents a service detour affecting one or more routes and directions within a specific time window.
NOTE: dataFeed is not well-documented by the CTA. As such, its presence here is primarily for
completeness and may not be populated or described correctly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanactive()Returns the value of theactiverecord component.@Nullable StringdataFeed()Returns the value of thedataFeedrecord component.Returns the value of thedescriptionrecord component.endTime()Returns the value of theendTimerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of therouteDirectionsrecord component.Returns the value of thestartTimerecord component.final StringtoString()Returns a string representation of this record class.version()Returns the value of theversionrecord component.
-
Constructor Details
-
Detour
public Detour(String id, String version, boolean active, String description, List<DetourRouteDirection> routeDirections, Instant startTime, Instant endTime, @Nullable String dataFeed) Constructs aDetour.- Parameters:
id- the unique identifier of the detourversion- the version of the detouractive- whether the detour is currently activedescription- the human-readable description of the detourrouteDirections- the routes and directions affected by the detourstartTime- the time at which the detour beginsendTime- the time at which the detour endsdataFeed- the identifier for the data feed that supplied the detour, ornullif not available- Throws:
NullPointerException- ifid,version,description,routeDirections,startTime, orendTimeisnull
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
version
Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-
active
public boolean active()Returns the value of theactiverecord component.- Returns:
- the value of the
activerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
routeDirections
Returns the value of therouteDirectionsrecord component.- Returns:
- the value of the
routeDirectionsrecord component
-
startTime
Returns the value of thestartTimerecord component.- Returns:
- the value of the
startTimerecord component
-
endTime
Returns the value of theendTimerecord component.- Returns:
- the value of the
endTimerecord component
-
dataFeed
Returns the value of thedataFeedrecord component.- Returns:
- the value of the
dataFeedrecord component
-