-
Notifications
You must be signed in to change notification settings - Fork 0
/
Ticket.java
54 lines (40 loc) · 1.66 KB
/
Ticket.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.zybooks.lotterychecker;
import androidx.annotation.NonNull;
public class Ticket {
private long id;
private String startDate;
private String endDate;
private int[] numbers;
private int powerMegaBall;
private int win;
private boolean mega;
public Ticket() {}
public Ticket(long id, String startDate, String endDate, int[] numbers, int powerMegaBall, boolean mega, int win) {
this.id = id;
this.startDate = startDate;
this.endDate = endDate;
this.numbers = numbers;
this.powerMegaBall = powerMegaBall;
this.mega = mega;
this.win = win;
}
public Ticket (String startDate, String endDate, int[] numbers, int powerMegaBall, boolean mega, int win) {
this(-1, startDate, endDate, numbers, powerMegaBall, mega, 0);
}
public Ticket(String startDate, String endDate, int[] numbers, int powerMegaBall, boolean mega) {
this(-1, startDate, endDate, numbers, powerMegaBall, mega, 0);
}
public long getId() {return this.id;}
public String getStartDate() {return this.startDate;}
public String getEndDate() {return this.endDate;}
public int[] getNumbers() {return this.numbers;}
public int getPowerMegaBall() {return this.powerMegaBall;}
public boolean getMega() {return this.mega;}
public int getWin() {return win;}
@NonNull
public String toString() {
return numbers[0] + " " + numbers[1] + " " + numbers[2] + " " + numbers[3]
+ " " + numbers[4] + " " + powerMegaBall + "| Ending: " + endDate
+ " | ID: " + id + " Win: " + win;
}
}