-
Notifications
You must be signed in to change notification settings - Fork 1
/
Possession.java
103 lines (85 loc) · 1.89 KB
/
Possession.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package com.cpe.possession.model;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.validation.constraints.NotNull;
@Entity
public class Possession {
@EmbeddedId
/**
* Appel de l'identity d'une possession qui possède
* un idCard et un idUser.
*/
private PossessionIdentity possessionIdentity;
/**
* Corresspond au prix d'une carte.
*/
private Integer price;
/**
* Corresspond à l'energie d'une carte
*/
private Integer energyCard;
/**
* Corresspond à la date de dernière utilisation d'une carte.
*/
private Integer lastUsed;
/**
* Constructeur nul d'une possession.
*/
public Possession()
{
this(0,0,0,0,0);
}
/**
* Constructeur d'une possession avec tous les paramètres dont
* il a besion.
* @param id_card
* @param id_user
* @param price
* @param energyCard
* @param lastUsed
*/
public Possession(@NotNull Integer id_card, @NotNull Integer id_user, @NotNull Integer price, @NotNull Integer energyCard, @NotNull Integer lastUsed)
{
super();
this.possessionIdentity = new PossessionIdentity(id_card, id_user);
this.setPrice(price);
this.setEnergyCard(energyCard);
this.setLastUsed(lastUsed);
}
/**
* @return the price of the card.
*/
public Integer getPrice() {
return price;
}
/**
* @param set the price of the card to price
*/
public void setPrice(Integer price) {
this.price = price;
}
/**
* @return the energyCard of the card.
*/
public Integer getEnergyCard() {
return energyCard;
}
/**
* @param set the energyCard to energyCard
*/
public void setEnergyCard(Integer energyCard) {
this.energyCard = energyCard;
}
/**
* @return the lastUsed date of the card.
*/
public Integer getLastUsed() {
return lastUsed;
}
/**
* @param set the lastUsed date of the card to lastUsed.
*/
public void setLastUsed(Integer lastUsed) {
this.lastUsed = lastUsed;
}
}