Rev 1814 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1814 | Rev 1827 | ||
---|---|---|---|
1 | package pt.estgp.estgweb.domain.typesgen.controloatividadedocente; |
1 | package pt.estgp.estgweb.domain.typesgen.controloatividadedocente; |
2 | 2 | ||
3 | import com.owlike.genson.Genson; |
3 | import com.owlike.genson.Genson; |
- | 4 | import com.owlike.genson.GensonBuilder; |
|
4 | import org.apache.log4j.Logger; |
5 | import org.apache.log4j.Logger; |
5 | import pt.estgp.estgweb.domain.typesgen.BacoDataAbstractType; |
6 | import pt.estgp.estgweb.domain.typesgen.BacoDataAbstractType; |
6 | 7 | ||
7 | import java.util.ArrayList; |
8 | import java.util.ArrayList; |
8 | 9 | ||
9 | /** |
10 | /** |
10 | * Created by jorgemachado on 03/02/17. |
11 | * Created by jorgemachado on 03/02/17. |
11 | */ |
12 | */ |
12 | public class EsquemaPontos extends BacoDataAbstractType |
13 | public class EsquemaPontos extends BacoDataAbstractType |
13 | { |
14 | { |
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 | 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 | ArrayList<AtividadePontuada> atividades; |
16 | 17 | ||
17 | public ArrayList<AtividadePontuada> getAtividades() { |
18 | public ArrayList<AtividadePontuada> getAtividades() { |
18 | return atividades; |
19 | return atividades; |
19 | } |
20 | } |
20 | 21 | ||
21 | public void setAtividades(ArrayList<AtividadePontuada> atividades) { |
22 | public void setAtividades(ArrayList<AtividadePontuada> atividades) { |
22 | this.atividades = atividades; |
23 | this.atividades = atividades; |
23 | } |
24 | } |
24 | 25 | ||
25 | static Genson genson = new Genson.Builder() |
26 | static Genson genson = new GensonBuilder() |
26 | .include(1.5.0/docs/api/java/lang/Boolean.html">Boolean.class) |
27 | .include(1.5.0/docs/api/java/lang/Boolean.html">Boolean.class) |
27 | .include(1.5.0/docs/api/java/lang/Integer.html">Integer.class) |
28 | .include(1.5.0/docs/api/java/lang/Integer.html">Integer.class) |
28 | .include(1.5.0/docs/api/java/lang/Long.html">Long.class) |
29 | .include(1.5.0/docs/api/java/lang/Long.html">Long.class) |
29 | .include(1.5.0/docs/api/java/lang/Double.html">Double.class) |
30 | .include(1.5.0/docs/api/java/lang/Double.html">Double.class) |
30 | .include(1.5.0/docs/api/java/lang/Float.html">Float.class) |
31 | .include(1.5.0/docs/api/java/lang/Float.html">Float.class) |
31 | .include(EsquemaPontos.class) |
32 | .include(EsquemaPontos.class) |
32 | .include(AtividadePontuada.class) |
33 | .include(AtividadePontuada.class) |
33 | .create(); |
34 | .create(); |
34 | 35 | ||
35 | public 1.5.0/docs/api/java/lang/String.html">String toString() |
36 | public 1.5.0/docs/api/java/lang/String.html">String toString() |
36 | { |
37 | { |
37 | try { |
38 | try { |
38 | return genson.serialize(this); |
39 | return genson.serialize(this); |
39 | } catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e) { |
40 | } catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e) { |
40 | logger.error(e, e); |
41 | logger.error(e, e); |
41 | } |
42 | } |
42 | return ""; |
43 | return ""; |
43 | } |
44 | } |
44 | 45 | ||
45 | public static EsquemaPontos fromString(1.5.0/docs/api/java/lang/String.html">String json) |
46 | public static EsquemaPontos fromString(1.5.0/docs/api/java/lang/String.html">String json) |
46 | { |
47 | { |
47 | try { |
48 | try { |
48 | return genson.deserialize(json, EsquemaPontos.class); |
49 | return genson.deserialize(json, EsquemaPontos.class); |
49 | } catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e) { |
50 | } catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e) { |
50 | logger.error(e,e); |
51 | logger.error(e,e); |
51 | } |
52 | } |
52 | return null; |
53 | return null; |
53 | } |
54 | } |
54 | 55 | ||
55 | @1.5.0/docs/api/java/lang/Override.html">Override |
56 | @1.5.0/docs/api/java/lang/Override.html">Override |
56 | public boolean equals(5+0%2Fdocs%2Fapi+Object">Object o) { |
57 | public boolean equals(5+0%2Fdocs%2Fapi+Object">Object o) { |
57 | if (this == o) return true; |
58 | if (this == o) return true; |
58 | if (o == null || getClass() != o.getClass()) return false; |
59 | if (o == null || getClass() != o.getClass()) return false; |
59 | 60 | ||
60 | EsquemaPontos that = (EsquemaPontos) o; |
61 | EsquemaPontos that = (EsquemaPontos) o; |
61 | 62 | ||
62 | if (atividades != null ? !atividades.equals(that.atividades) : that.atividades != null) return false; |
63 | if (atividades != null ? !atividades.equals(that.atividades) : that.atividades != null) return false; |
63 | 64 | ||
64 | return true; |
65 | return true; |
65 | } |
66 | } |
66 | 67 | ||
67 | @1.5.0/docs/api/java/lang/Override.html">Override |
68 | @1.5.0/docs/api/java/lang/Override.html">Override |
68 | public int hashCode() { |
69 | public int hashCode() { |
69 | return atividades != null ? atividades.hashCode() : 0; |
70 | return atividades != null ? atividades.hashCode() : 0; |
70 | } |
71 | } |
71 | } |
72 | } |
72 | 73 |