Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
# Mobile Tools for Java (J2ME)
.mtj.tmp/

# vim swap files
*.swp

# Package Files #
*.jar
!gradle-wrapper.jar
Expand Down
Binary file removed .gradle/6.3/executionHistory/executionHistory.lock
Binary file not shown.
Binary file removed .gradle/6.3/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/6.3/fileHashes/fileHashes.lock
Binary file not shown.
Empty file removed .gradle/6.3/gc.properties
Empty file.
Binary file removed .gradle/6.5/executionHistory/executionHistory.bin
Binary file not shown.
Binary file removed .gradle/6.5/executionHistory/executionHistory.lock
Binary file not shown.
Binary file removed .gradle/6.5/fileChanges/last-build.bin
Binary file not shown.
Binary file removed .gradle/6.5/fileHashes/fileHashes.bin
Binary file not shown.
Binary file removed .gradle/6.5/fileHashes/fileHashes.lock
Binary file not shown.
Empty file removed .gradle/6.5/gc.properties
Empty file.
Binary file removed .gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 0 additions & 2 deletions .gradle/buildOutputCleanup/cache.properties

This file was deleted.

Binary file removed .gradle/checksums/checksums.lock
Binary file not shown.
Empty file removed .gradle/vcs-1/gc.properties
Empty file.
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/compiler.xml

This file was deleted.

18 changes: 0 additions & 18 deletions .idea/gradle.xml

This file was deleted.

20 changes: 0 additions & 20 deletions .idea/jarRepositories.xml

This file was deleted.

7 changes: 0 additions & 7 deletions .idea/misc.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
# Примеры для курса "Разработчик Java" в OTUS
Напишите свой json object writer (object to JSON string) аналогичный gson на основе javax.json.

Группа 2020-09
Gson это делает так: Gson gson = new Gson(); AnyObject obj = new AnyObject(22, "test", 10); String json = gson.toJson(obj);

### Преподаватели
Сергей Петрелевич<br>
Стрекалов Павел<br>
Александр Оруджев<br>
Вячеслав Лапин<br>
Виталий Куценко<br>
Дмитрий Коган
Сделайте так: MyGson myGson = new MyGson(); AnyObject obj = new AnyObject(22, "test", 10); String myJson = myGson.toJson(obj);

Студент:
Kashapov Renat (Кашапов Ренат)<br>
renat.kashapov@gmail.com
Должно получиться: AnyObject obj2 = gson.fromJson(myJson, AnyObject.class); System.out.println(obj.equals(obj2));

Поддержите:

примитивные типы и Wrapper-ы (Integer, Float и т.д.) строки массивы примитивных типов коллекции (interface Collection)
Не забываться, что obj может быть null :)
36 changes: 36 additions & 0 deletions hw08-MyGSON/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
plugins {
id 'java'
}

group 'ru.otus'
version '1.0-SNAPSHOT'

repositories {
mavenCentral()
}

dependencies {
// https://mvnrepository.com/artifact/com.google.code.gson/gson
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
// https://mvnrepository.com/artifact/javax.json/javax.json-api
compile group: 'javax.json', name: 'javax.json-api', version: '1.1.4'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: '5.7.0'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-engine
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.7.0'
// https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-params
testCompile group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.7.0'
// https://mvnrepository.com/artifact/org.assertj/assertj-core
testCompile group: 'org.assertj', name: 'assertj-core', version: '3.18.1'
// https://mvnrepository.com/artifact/org.mockito/mockito-core
testCompile group: 'org.mockito', name: 'mockito-core', version: '3.6.28'
// https://mvnrepository.com/artifact/org.mockito/mockito-junit-jupiter
testCompile group: 'org.mockito', name: 'mockito-junit-jupiter', version: '3.6.28'
// https://mvnrepository.com/artifact/org.glassfish/javax.json
compile group: 'org.glassfish', name: 'javax.json', version: '1.1.4'

}

test {
useJUnitPlatform()
}
Loading