Rev 1653 | Rev 1778 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1653 | jmachado | 1 | package pt.estgp.estgweb.services.bpmnprocess.controloatividadedocente; |
2 | |||
3 | import com.owlike.genson.Genson; |
||
4 | import org.apache.log4j.Logger; |
||
1670 | jmachado | 5 | import pt.estgp.estgweb.services.bpmnprocess.types.BacoDataAbstractType; |
1653 | jmachado | 6 | |
7 | import java.util.ArrayList; |
||
8 | |||
9 | /** |
||
10 | * Created by jorgemachado on 03/02/17. |
||
11 | */ |
||
1670 | jmachado | 12 | public class EsquemaPontos extends BacoDataAbstractType |
1653 | jmachado | 13 | { |
14 | private static final 1.5.0/docs/api/java/util/logging/Logger.html">Logger logger = 1.5.0/docs/api/java/util/logging/Logger.html">Logger.getLogger(EsquemaPontos.class); |
||
15 | ArrayList<AtividadePontuada> atividades; |
||
16 | |||
17 | public ArrayList<AtividadePontuada> getAtividades() { |
||
18 | return atividades; |
||
19 | } |
||
20 | |||
21 | public void setAtividades(ArrayList<AtividadePontuada> atividades) { |
||
22 | this.atividades = atividades; |
||
23 | } |
||
24 | |||
25 | static Genson genson = new Genson.Builder() |
||
26 | .include(EsquemaPontos.class) |
||
27 | .include(AtividadePontuada.class) |
||
28 | .create(); |
||
29 | |||
30 | public 1.5.0/docs/api/java/lang/String.html">String toString() |
||
31 | { |
||
32 | try { |
||
33 | return genson.serialize(this); |
||
34 | } catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e) { |
||
35 | logger.error(e, e); |
||
36 | } |
||
37 | return ""; |
||
38 | } |
||
39 | |||
40 | public static EsquemaPontos fromString(1.5.0/docs/api/java/lang/String.html">String json) |
||
41 | { |
||
42 | try { |
||
43 | return genson.deserialize(json, EsquemaPontos.class); |
||
44 | } catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e) { |
||
45 | logger.error(e,e); |
||
46 | } |
||
47 | return null; |
||
48 | } |
||
49 | |||
50 | @1.5.0/docs/api/java/lang/Override.html">Override |
||
51 | public boolean equals(5+0%2Fdocs%2Fapi+Object">Object o) { |
||
52 | if (this == o) return true; |
||
53 | if (o == null || getClass() != o.getClass()) return false; |
||
54 | |||
55 | EsquemaPontos that = (EsquemaPontos) o; |
||
56 | |||
57 | if (atividades != null ? !atividades.equals(that.atividades) : that.atividades != null) return false; |
||
58 | |||
59 | return true; |
||
60 | } |
||
61 | |||
62 | @1.5.0/docs/api/java/lang/Override.html">Override |
||
63 | public int hashCode() { |
||
64 | return atividades != null ? atividades.hashCode() : 0; |
||
65 | } |
||
66 | } |