Skip to content

Commit 9c7b6c8

Browse files
authored
shut him up
And cast him into the bottomless pit, and shut him up, and set a seal upon him, that he should deceive the nations no more, till the thousand years should be fulfilled: and after that he must be loosed a little season. (Revelation 20:3)
1 parent c52547d commit 9c7b6c8

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
//And cast him into the bottomless pit, and shut him up, and set a seal upon him, that he should deceive the nations no more, till the thousand years should be fulfilled: and after that he must be loosed a little season. (Revelation 20:3)
3+
4+
package com.javarush.task.task33.task3303;
5+
6+
import java.io.File;
7+
import java.io.FileReader;
8+
import java.io.IOException;
9+
import java.io.StringReader;
10+
11+
import com.fasterxml.jackson.annotation.JsonAutoDetect;
12+
import com.fasterxml.jackson.annotation.JsonIgnore;
13+
import com.fasterxml.jackson.annotation.JsonProperty;
14+
import com.fasterxml.jackson.databind.ObjectMapper;
15+
16+
/*
17+
Десериализация JSON объекта
18+
*/
19+
public class Solution {
20+
public static <T> T convertFromJsonToNormal(String fileName, Class<T> clazz) throws IOException {
21+
T result = null;
22+
ObjectMapper mapper = new ObjectMapper();
23+
StringReader reader;
24+
25+
26+
27+
result = mapper.readValue(new FileReader(new File(fileName)), clazz);
28+
return result;
29+
}
30+
31+
public static void main(String[] args) {
32+
33+
}
34+
}
35+
36+
/*
37+
Десериализация JSON объекта
38+
39+
НЕОБХОДИМО: подключенные библиотеки Jackson Core, Bind и Annotation версии 2.6.1
40+
41+
42+
43+
В метод convertFromJsonToNormal первым параметром приходит имя файла, который содержит один ДЖЕЙСОН объект.
44+
45+
Вторым параметром приходит имя класса, объект которого находится в файле.
46+
47+
Метод convertFromJsonToNormal должен вычитать объект из файла, преобразовать его из JSON и вернуть.
48+
49+
50+
51+
52+
53+
Требования:
54+
55+
1. В методе convertFromJsonToNormal должен быть создан объект типа ObjectMapper с помощью конструктора без параметров.
56+
57+
2. Объект возвращаемый методом convertFromJsonToNormal должен быть получен с помощью метода readValue класса ObjectMapper.
58+
59+
3. Метод convertFromJsonToNormal должен быть статическим.
60+
61+
4. Метод convertFromJsonToNormal должен быть публичным.
62+
*/

0 commit comments

Comments
 (0)