source: src/main/java/com/tourMate/dto/RouteListingDto.java

Last change on this file was 07f4e8b, checked in by darsov2 <62809499+darsov2@…>, 12 months ago

prefinal fixes

  • Property mode set to 100644
File size: 2.1 KB
RevLine 
[e6c2521]1package com.tourMate.dto;
2
3import com.fasterxml.jackson.annotation.JsonIgnore;
4import com.tourMate.entities.Transport;
5import com.tourMate.entities.TransportRoute;
6import jakarta.persistence.Temporal;
7import jakarta.persistence.TemporalType;
8
9import java.util.Collection;
10import java.util.Date;
11
12public class RouteListingDto {
13 private long transportAvailibleId;
14 private String from;
15 private String to;
16 private Date date;
17 private int freeSpace;
18 private Date time;
19 private Collection<String> routes;
[07f4e8b]20 private Double maxPrice;
[e6c2521]21
[07f4e8b]22 public RouteListingDto(long transportAvailibleId, String from, String to, Date date, int freeSpace, Date time, Collection<TransportRoute> routes, Double maxPrice) {
[e6c2521]23 this.transportAvailibleId = transportAvailibleId;
24 this.from = from;
25 this.to = to;
26 this.date = date;
27 this.freeSpace = freeSpace;
28 this.time = time;
29 this.routes = routes.stream().map(x -> x.getFrom()).distinct().skip(1).toList();
[07f4e8b]30 this.maxPrice = maxPrice;
[e6c2521]31 }
32
33 public long getTransportAvailibleId() {
34 return transportAvailibleId;
35 }
36
37 public void setTransportAvailibleId(long transportAvailibleId) {
38 this.transportAvailibleId = transportAvailibleId;
39 }
40
41 public String getFrom() {
42 return from;
43 }
44
45 public void setFrom(String from) {
46 this.from = from;
47 }
48
49 public String getTo() {
50 return to;
51 }
52
53 public void setTo(String to) {
54 this.to = to;
55 }
56
57 public Date getDate() {
58 return date;
59 }
60
61 public void setDate(Date date) {
62 this.date = date;
63 }
64
65 public int getFreeSpace() {
66 return freeSpace;
67 }
68
69 public void setFreeSpace(int freeSpace) {
70 this.freeSpace = freeSpace;
71 }
72
73 public Date getTime() {
74 return time;
75 }
76
77 public void setTime(Date time) {
78 this.time = time;
79 }
80
81 public Collection<String> getRoutes() {
82 return routes;
83 }
84
85 public void setRoutes(Collection<String> routes) {
86 this.routes = routes;
87 }
[07f4e8b]88
89 public Double getMaxPrice() {
90 return maxPrice;
91 }
[e6c2521]92}
Note: See TracBrowser for help on using the repository browser.