Package com.cta4j.bus.pattern.model
Record Class PatternPoint
java.lang.Object
java.lang.Record
com.cta4j.bus.pattern.model.PatternPoint
- Record Components:
sequence- the position of this pattern point in the overall sequence of pointstype- the type of this pattern pointstopId- the identifier of the stop associated with this pattern point, if applicablestopName- the name of the stop associated with this pattern point, if applicabledistanceToPatternPoint- the distance to the next pattern point, if applicablelatitude- the latitude coordinate of this pattern pointlongitude- the longitude coordinate of this pattern point
@NullMarked
public record PatternPoint(int sequence, PatternPointType type, @Nullable String stopId, @Nullable String stopName, @Nullable BigDecimal distanceToPatternPoint, BigDecimal latitude, BigDecimal longitude)
extends Record
Represents a point in a bus route pattern.
-
Constructor Summary
ConstructorsConstructorDescriptionPatternPoint(int sequence, PatternPointType type, @Nullable String stopId, @Nullable String stopName, @Nullable BigDecimal distanceToPatternPoint, BigDecimal latitude, BigDecimal longitude) Constructs aPatternPoint. -
Method Summary
Modifier and TypeMethodDescription@Nullable BigDecimalReturns the value of thedistanceToPatternPointrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.latitude()Returns the value of thelatituderecord component.Returns the value of thelongituderecord component.intsequence()Returns the value of thesequencerecord component.@Nullable StringstopId()Returns the value of thestopIdrecord component.@Nullable StringstopName()Returns the value of thestopNamerecord component.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
PatternPoint
public PatternPoint(int sequence, PatternPointType type, @Nullable String stopId, @Nullable String stopName, @Nullable BigDecimal distanceToPatternPoint, BigDecimal latitude, BigDecimal longitude) Constructs aPatternPoint.- Parameters:
sequence- the position of the pattern point in the overall sequence of pointstype- the type of the pattern pointstopId- the identifier of the stop associated with the pattern point, if applicablestopName- the name of the stop associated with the pattern point, if applicabledistanceToPatternPoint- the distance to the next pattern point, if applicablelatitude- the latitude coordinate of the pattern pointlongitude- the longitude coordinate of the pattern point- Throws:
NullPointerException- iftype,latitude, orlongitudeisnull
-
-
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 '=='. -
sequence
public int sequence()Returns the value of thesequencerecord component.- Returns:
- the value of the
sequencerecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
stopId
Returns the value of thestopIdrecord component.- Returns:
- the value of the
stopIdrecord component
-
stopName
Returns the value of thestopNamerecord component.- Returns:
- the value of the
stopNamerecord component
-
distanceToPatternPoint
Returns the value of thedistanceToPatternPointrecord component.- Returns:
- the value of the
distanceToPatternPointrecord component
-
latitude
Returns the value of thelatituderecord component.- Returns:
- the value of the
latituderecord component
-
longitude
Returns the value of thelongituderecord component.- Returns:
- the value of the
longituderecord component
-