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 points
type - the type of this pattern point
stopId - the identifier of the stop associated with this pattern point, if applicable
stopName - the name of the stop associated with this pattern point, if applicable
distanceToPatternPoint - the distance to the next pattern point, if applicable
latitude - the latitude coordinate of this pattern point
longitude - 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 Details

    • PatternPoint

      public PatternPoint(int sequence, PatternPointType type, @Nullable String stopId, @Nullable String stopName, @Nullable BigDecimal distanceToPatternPoint, BigDecimal latitude, BigDecimal longitude)
      Constructs a PatternPoint.
      Parameters:
      sequence - the position of the pattern point in the overall sequence of points
      type - the type of the pattern point
      stopId - the identifier of the stop associated with the pattern point, if applicable
      stopName - the name of the stop associated with the pattern point, if applicable
      distanceToPatternPoint - the distance to the next pattern point, if applicable
      latitude - the latitude coordinate of the pattern point
      longitude - the longitude coordinate of the pattern point
      Throws:
      NullPointerException - if type, latitude, or longitude is null
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • sequence

      public int sequence()
      Returns the value of the sequence record component.
      Returns:
      the value of the sequence record component
    • type

      public PatternPointType type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • stopId

      public @Nullable String stopId()
      Returns the value of the stopId record component.
      Returns:
      the value of the stopId record component
    • stopName

      public @Nullable String stopName()
      Returns the value of the stopName record component.
      Returns:
      the value of the stopName record component
    • distanceToPatternPoint

      public @Nullable BigDecimal distanceToPatternPoint()
      Returns the value of the distanceToPatternPoint record component.
      Returns:
      the value of the distanceToPatternPoint record component
    • latitude

      public BigDecimal latitude()
      Returns the value of the latitude record component.
      Returns:
      the value of the latitude record component
    • longitude

      public BigDecimal longitude()
      Returns the value of the longitude record component.
      Returns:
      the value of the longitude record component