All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.model.plan.TripPlan Maven / Gradle / Ivy

package org.opentripplanner.model.plan;

import java.time.Instant;
import java.util.Collection;
import java.util.List;
import org.opentripplanner.util.lang.ToStringBuilder;

/**
 * A TripPlan is a set of ways to get from point A to point B at time T.
 */
public class TripPlan {

  /** The time and date of travel */
  public final Instant date;

  /** The origin */
  public final Place from;

  /** The destination */
  public final Place to;

  public final List itineraries;

  public TripPlan(Place from, Place to, Instant date, Collection itineraries) {
    this.from = from;
    this.to = to;
    this.date = date;
    this.itineraries = List.copyOf(itineraries);
  }

  @Override
  public String toString() {
    return ToStringBuilder
      .of(TripPlan.class)
      .addObj("date", date)
      .addObj("from", from)
      .addObj("to", to)
      .addObj("itineraries", itineraries)
      .toString();
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy