Skip to content

Commit 246dbd4

Browse files
authored
until the thousand
But the rest of the dead lived not again until the thousand years were finished. This is the first resurrection. (Revelation 20:5)
1 parent b3713cb commit 246dbd4

1 file changed

Lines changed: 98 additions & 0 deletions

File tree

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
2+
//But the rest of the dead lived not again until the thousand years were finished. This is the first resurrection. (Revelation 20:5)
3+
4+
package com.javarush.task.task33.task3305;
5+
6+
public class RaceBike extends Motorbike {
7+
private String owner;
8+
private int age;
9+
10+
public RaceBike(String name, String owner, int age) {
11+
super(name);
12+
this.owner = owner;
13+
this.age = age;
14+
}
15+
16+
public String getName() {
17+
return name;
18+
}
19+
20+
public String getOwner() {
21+
return owner;
22+
}
23+
24+
public int getAge() {
25+
return age;
26+
}
27+
28+
@Override
29+
public String toString() {
30+
return "RaceBike{" +
31+
"name='" + name + '\'' +
32+
", owner='" + owner + '\'' +
33+
", age=" + age +
34+
'}';
35+
}
36+
}
37+
38+
/*
39+
Конвертация из одного класса в другой используя JSON
40+
41+
НЕОБХОДИМО: подключенные библиотеки Jackson Core, Bind и Annotation версии 2.6.1
42+
43+
44+
45+
Расставь JSON аннотации так, чтобы результат выполнения метода main был следующим:
46+
47+
{
48+
49+
"className" : ".Parking",
50+
51+
"name" : "Super Parking",
52+
53+
"city" : "Kyiv",
54+
55+
"autos" : [ {
56+
57+
"className" : "com.javarush.task.task33.task3305.RaceBike",
58+
59+
"name" : "Simba",
60+
61+
"owner" : "Peter",
62+
63+
"age" : 2
64+
65+
}, {
66+
67+
"className" : "com.javarush.task.task33.task3305.Motorbike",
68+
69+
"name" : "Manny",
70+
71+
"owner" : null
72+
73+
}, {
74+
75+
"className" : "com.javarush.task.task33.task3305.Car"
76+
77+
} ]
78+
79+
}
80+
81+
82+
83+
Подсказка: это всего два класса.
84+
85+
86+
87+
88+
89+
Требования:
90+
91+
1. Вывод на экран должен соответствовать условию задачи.
92+
93+
2. Класс Parking должен быть отмечен аннотацией @JsonTypeInfo с подходящим набором параметров.
94+
95+
3. Класс Auto должен быть отмечен аннотацией @JsonTypeInfo с подходящим набором параметров.
96+
97+
4. Класс Auto должен быть отмечен аннотацией @JsonSubTypes с подходящим набором параметров.
98+
*/

0 commit comments

Comments
 (0)