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
434726
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;
   }
25507
@VisibleForTesting
  List<Name> names(Iterable<String> names) {
    List<Name> result = new ArrayList<>();
    for (String name : names) {
      result.add(name(name));
    }
    return result;
  }
676859
private void readObject(java.io.ObjectInputStream s)
        throws java.io.IOException,
               java.io.NotActiveException,
               ClassNotFoundException {

        // re-create thisX500Name
        thisX500Name = new X500Name((byte[])s.readObject());
    }
14747
public int expectInt() throws IOException {
        int b1 = in.read();
        if (b1 < 0) {
            throw new IOException("Missing byte 1 to expected int");
        }
        int b2 = in.read();
        if (b2 < 0) {
            throw new IOException("Missing byte 2 to expected int");
        }
        int b3 = in.read();
        if (b3 < 0) {
            throw new IOException("Missing byte 3 to expected int");
        }
        int b4 = in.read();
        if (b4 < 0) {
            throw new IOException("Missing byte 4 to expected int");
        }
        return unshift4bytes(b1, b2, b3, b4);
    }
1305690
public File newFile(String fileName) throws IOException {
        File file = new File(getRoot(), fileName);
        if (!file.createNewFile()) {
            throw new IOException(
                    "a file with the name \'" + fileName + "\' already exists in the test folder");
        }
        return file;
    }
83816
public static <T> Map<String, T> getByName(List<T> namedObjects, Function<T, String> nameFn, BinaryOperator<T> mergeFunc) {
        return namedObjects.stream().collect(Collectors.toMap(
                nameFn,
                identity(),
                mergeFunc,
                LinkedHashMap::new)
        );
    }
640292
public Map<String, Class<?>> scan(String classNamePattern) throws IOException {
        final Map<String, Class<?>> scannedClasses = new LinkedHashMap<>();
        scan(classNamePattern, scannedClasses);
        return scannedClasses;
    }
1339848
public static void readField(JsonParser jsonParser,
                               String expectedFieldName) throws IOException {
    readToken(jsonParser, expectedFieldName, JsonToken.FIELD_NAME);
    String fieldName = jsonParser.getCurrentName();
    if (!fieldName.equals(expectedFieldName)) {
      foundUnknownField(fieldName, expectedFieldName);
    }
  }
240470
private static Map<String, String[]> getSynonyms(InputStream config) throws IOException
   {
      try
      {
         Map<String, String[]> synonyms = new HashMap<String, String[]>();
         Properties props = new Properties();
         props.load(config);
         Iterator<Map.Entry<Object, Object>> it = props.entrySet().iterator();
         while (it.hasNext())
         {
            Map.Entry<Object, Object> e = it.next();
            String key = (String)e.getKey();
            String value = (String)e.getValue();
            addSynonym(key, value, synonyms);
            addSynonym(value, key, synonyms);
         }
         return synonyms;
      }
      catch (Exception e)
      {
         throw Util.createIOException(e);
      }
   }
513369
public JsonReader beginArray(String expectedName) throws IOException {
      String name = beginArray();
      if (!StringUtils.isNullOrBlank(expectedName) && (name == null || !name.equals(expectedName))) {
         throw new IOException("Expected " + expectedName);
      }
      return this;
   }
243026
public String peekName() throws IOException {
      if (currentValue.getKey() != NAME) {
         return StringUtils.EMPTY;
      }
      return currentValue.getValue().asString();
   }
168159
private synchronized void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException {
        in.defaultReadObject();

        // rebuild hash hashtable
        hash = new Hashtable<>();
        for (NameValue<N, V> nameValue : order) {
            putInHash(nameValue.name, nameValue.value);
        }
    }
1167337
public T getNext() throws IOException {
    try {
      return mapper.readValue(jsonParser, clazz);
    } catch (EOFException e) {
      return null;
    }
  }
557008
public JClass forName(String name)
  {
    SoftReference<JClass> jClassRef = _classMap.get(name);

    JClass jClass = jClassRef != null ? jClassRef.get() : null;

    if (jClass == null) {
      jClass = _staticClassMap.get(name);

      if (jClass == null) {
        if (name.startsWith("[")) {
          JClass subClass = descriptorToClass(name, 1);
          jClass = new JClassArray(subClass);
        }
        else
          jClass = loadClass(name);
      }
      
      _classMap.put(name, new SoftReference<JClass>(jClass));
    }

    return jClass;
  }
494981
public ObjectName build() {
    final String name = nameStrBuilder.substring(0, nameStrBuilder.length() - 1);
    try {
      return new ObjectName(name);
    } catch (MalformedObjectNameException e) {
      LOG.warn("Invalid ObjectName provided: " + name);
      throw Throwables.propagate(e);
    }
  }
335236
public static long next(final String name){
        String id = null;
        try{
            id = Locks.lockEntityQuite(new StorageId(NumberSequence.class, null, null, name), 30, TimeUnit.SECONDS);
            long l = getLocalStorage().read(name);
            l++;
            DDSCluster.call(new MessageBean(NumberSequence.class, null, null, name, "set",
                    Objects.newHashMap(String.class, Object.class, "value", l)));
            return l;
        }finally {
            Locks.releaseLock(id);
        }
    }
159469
public String nextName() throws IOException {
    int p = peeked;
    if (p == PEEKED_NONE) {
      p = doPeek();
    }
    String result;
    if (p == PEEKED_UNQUOTED_NAME) {
      result = nextUnquotedValue();
    } else if (p == PEEKED_SINGLE_QUOTED_NAME) {
      result = nextQuotedValue('\'');
    } else if (p == PEEKED_DOUBLE_QUOTED_NAME) {
      result = nextQuotedValue('"');
    } else {
      throw new IllegalStateException("Expected a name but was " + peek() + locationString());
    }
    peeked = PEEKED_NONE;
    pathNames[stackSize - 1] = result;
    return result;
  }