View Javadoc

1   package se.citerus.dddsample.interfaces.booking.facade.dto;
2   
3   import java.io.Serializable;
4   import java.util.Collections;
5   import java.util.List;
6   
7   /**
8    * DTO for presenting and selecting an itinerary from a collection of candidates.
9    */
10  public final class RouteCandidateDTO implements Serializable {
11  
12    private final List<LegDTO> legs;
13  
14    /**
15     * Constructor.
16     *
17     * @param legs The legs for this itinerary.
18     */
19    public RouteCandidateDTO(final List<LegDTO> legs) {
20      this.legs = legs;
21    }
22  
23    /**
24     * @return An unmodifiable list DTOs.
25     */
26    public List<LegDTO> getLegs() {
27      return Collections.unmodifiableList(legs);
28    }
29  }