public Map<String, Val> nextMap(String expectedName) throws IOException {
      boolean ignoreObject = peek() != JsonTokenType.BEGIN_OBJECT && StringUtils.isNullOrBlank(expectedName);
      if (!ignoreObject) beginObject(expectedName);
      Map<String, Val> map = new HashMap<>();
      while (peek() != JsonTokenType.END_OBJECT && peek() != JsonTokenType.END_DOCUMENT) {
         Tuple2<String, Val> kv = nextKeyValue();
         map.put(kv.getKey(), kv.getValue());
      }
      if (!ignoreObject) endObject();
      return map;
   }
public Map < String , Val > nextMap ( String expectedName ) throws IOException { boolean ignoreObject = peek ( ) != JsonTokenType . BEGIN_OBJECT && StringUtils . isNullOrBlank ( expectedName ) ; if ( ! ignoreObject ) beginObject ( expectedName ) ; Map < String , Val > map = new HashMap < > ( ) ; while ( peek ( ) != JsonTokenType . END_OBJECT && peek ( ) != JsonTokenType . END_DOCUMENT ) { Tuple2 < String , Val > kv = nextKeyValue ( ) ; map . put ( kv . getKey ( ) , kv . getValue ( ) ) ; } if ( ! ignoreObject ) endObject ( ) ; return map ; }
Reads in the next object as a map with an expected name

@param expectedName the expected name of the next object
@return the map
@throws IOException Something went wrong reading