FareAttribute Data Type

All OTP Transit entities should extend this class. The purpose of the class is to enforce a common implementation of the identity:

  1. id - All entities should have an id. The id should be unique within the context the entity live. For aggregates which live in a global space the id must be unique. This apply to all entities listed in the index service.
  2. The hashCode()/equals() method is consistent and based on the id (identity). We frequently use this to index and lookup entities.

Implemented Interfaces
Serializable
Properties
name data type constraints description
price number required
currencyType string  
paymentMethod number required
transfersSet boolean required
transfers number required
transferDurationSet boolean required
transferDuration number required
journeyDurationSet boolean required
journeyDuration number required
youthPrice number required
seniorPrice number required
Properties inherited from TransitEntity
id FeedScopedId  

Example

{
  "price" : 12345.0,
  "currencyType" : "...",
  "paymentMethod" : 12345,
  "transfersSet" : true,
  "transfers" : 12345,
  "transferDurationSet" : true,
  "transferDuration" : 12345,
  "journeyDurationSet" : true,
  "journeyDuration" : 12345,
  "youthPrice" : 12345.0,
  "seniorPrice" : 12345.0,
  "id" : {
    "feedId" : "...",
    "id" : "..."
  }
}