@@ -77,6 +77,15 @@ public Multimap<Leg, FareProductInstance> getLegProducts() {
7777    return  ImmutableMultimap .copyOf (legProducts );
7878  }
7979
80+   /** 
81+    * Add a "fare". This is an ill-defined concept (is it for the entire itinerary or only some 
82+    * legs?) from the early days of OTP which will be removed in the future. 
83+    * <p> 
84+    * Use {@link ItineraryFares#addFareProduct(Leg, FareProduct)}, 
85+    * {@link ItineraryFares#addLegProducts(Collection)} or 
86+    * {@link ItineraryFares#addItineraryProducts(Collection)} instead. 
87+    */ 
88+   @ Deprecated 
8089  public  void  addFare (FareType  fareType , Money  money ) {
8190    itineraryProducts .add (
8291      new  FareProduct (
@@ -90,6 +99,14 @@ public void addFare(FareType fareType, Money money) {
9099    );
91100  }
92101
102+   /** 
103+    * Add a collection of "fare components" for a type. These concepts are ill-defined and will be 
104+    * removed in the future. 
105+    * <p> 
106+    * Use @{link {@link ItineraryFares#addItineraryProducts(Collection)}}, 
107+    * {@link ItineraryFares#addFareProduct(Leg, FareProduct)} or 
108+    * {@link ItineraryFares#addLegProducts(Collection)} instead. 
109+    */ 
93110  @ Deprecated 
94111  public  void  addFareComponent (FareType  fareType , List <FareComponent > components ) {
95112    this .components .replaceValues (fareType , components );
@@ -120,6 +137,14 @@ public void addItineraryProducts(Collection<FareProduct> products) {
120137    itineraryProducts .addAll (products );
121138  }
122139
140+   /** 
141+    * Get the "fare" for a specific fare type. 
142+    * <p> 
143+    * It is ill-defined what this actually means (entire itinerary?, some legs?). 
144+    * <p> 
145+    * Use {@link ItineraryFares#getItineraryProducts()} or {@link ItineraryFares#getLegProducts()} 
146+    * instead. 
147+    */ 
123148  public  Money  getFare (FareType  type ) {
124149    return  itineraryProducts 
125150      .stream ()
@@ -129,10 +154,21 @@ public Money getFare(FareType type) {
129154      .orElse (null );
130155  }
131156
157+   /** 
158+    * Get the "components" of a fare for a specific type. 
159+    * <p> 
160+    * Use {@link ItineraryFares#getItineraryProducts()} or {@link ItineraryFares#getLegProducts()} 
161+    * instead. 
162+    */ 
163+   @ Deprecated 
132164  public  List <FareComponent > getComponents (FareType  type ) {
133165    return  List .copyOf (components .get (type ));
134166  }
135167
168+   /** 
169+    * Return the set of {@link FareType}s that are contained in this instance. 
170+    */ 
171+   @ Deprecated 
136172  public  Set <FareType > getFaresV1Types () {
137173    return  itineraryProducts 
138174      .stream ()
@@ -144,7 +180,7 @@ public Set<FareType> getFaresV1Types() {
144180
145181  @ Override 
146182  public  int  hashCode () {
147-     return  Objects .hash (itineraryProducts , legProducts );
183+     return  Objects .hash (itineraryProducts , legProducts ,  components );
148184  }
149185
150186  @ Override 
@@ -167,6 +203,9 @@ public String toString() {
167203      .toString ();
168204  }
169205
206+   /** 
207+    * Add a complex set of fare products for a specific leg; 
208+    */ 
170209  public  void  addLegProducts (Collection <LegProducts > legProducts ) {
171210    legProducts .forEach (lp  -> {
172211      var  time  = lp .leg ().getStartTime ();
@@ -180,6 +219,9 @@ public void addLegProducts(Collection<LegProducts> legProducts) {
180219    });
181220  }
182221
222+   /** 
223+    * Add a single fare product for a single leg. 
224+    */ 
183225  public  void  addFareProduct (Leg  leg , FareProduct  fareProduct ) {
184226    this .legProducts .put (
185227        leg ,
0 commit comments