Skip to content

Commit

Permalink
feat: major usability improvements for TypeContainer and jsonTypeOf &…
Browse files Browse the repository at this point in the history
…& less method overloading
  • Loading branch information
YunaBraska committed Mar 14, 2024
1 parent 70d45ee commit b3a991a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/test/java/berlin/yuna/typemap/model/TypeMapTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.*;
import java.util.stream.Stream;

import static berlin.yuna.typemap.logic.JsonDecoder.jsonTypeOf;
import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
import static org.assertj.core.api.Assertions.assertThat;
Expand Down Expand Up @@ -232,11 +233,10 @@ void showCaseTest() {
+ " }\n"
+ "}";

final TypeMap jsonMap = new TypeMap(jsonString);
final TypeContainer<?> jsonMap = jsonTypeOf(jsonString);
final LinkedTypeMap map1 = jsonMap.getMap("outerMap", "innerMap");
final TestEnum testEnum = jsonMap.getList("outerMap", "myList").get(TestEnum.class, 0);


final Optional<Date> myDate = jsonMap.getOpt(Date.class, "outerMap", "innerMap", "timestamp");
final Optional<Long> myTimestamp = jsonMap.getOpt(Long.class, "outerMap", "innerMap", "timestamp");
final Optional<TestEnum> myEnum = jsonMap.getOpt(TestEnum.class, "outerMap", "myList", 0);
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.10
2.0.0

0 comments on commit b3a991a

Please sign in to comment.