java.lang.Object
java.lang.Record
com.cta4j.bus.model.Detour
- Record Components:
id- the unique identifier of the detourversion- the version number of the detouractive- whether the detour is currently activedescription- a description of the detourrouteDirections- the list of route directions affected by the detourstartTime- the start time of the detourendTime- the end time of the detour
public record Detour(String id, String version, Boolean active, String description, List<DetourRouteDirection> routeDirections, Instant startTime, Instant endTime)
extends Record
A detour affecting one or more bus routes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionactive()Returns the value of theactiverecord 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) Creates an instance of aDetourrecord class.- Parameters:
id- the value for theidrecord componentversion- the value for theversionrecord componentactive- the value for theactiverecord componentdescription- the value for thedescriptionrecord componentrouteDirections- the value for therouteDirectionsrecord componentstartTime- the value for thestartTimerecord componentendTime- the value for theendTimerecord component
-
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
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
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
-