Un-serialize a Json into BuildInfo
@param buildInfo String
@return Map<String,String>
@throws IOException
767310
public static Map<String,String> unserializeBuildInfo(final String buildInfo) throws IOException {
        final ObjectMapper mapper = new ObjectMapper();
        mapper.disable(MapperFeature.USE_GETTERS_AS_SETTERS);
        return mapper.readValue(buildInfo,   new TypeReference<Map<String, Object>>(){});
    }
1210824
@Override
    public JsonNode getJsonNode(PortletPreferences prefs, String key) throws IOException {
        final String prefValue = StringUtils.trimToNull(prefs.getValue(key, null));
        if (prefValue == null) {
            // Default to an empty object
            return mapper.createObjectNode();
        }
        return mapper.readTree(prefValue);
    }
931788
String build() throws IOException {

		if (built) {
			// Can call build only once per instance
			throw new IllegalStateException();
		}
		built = true;

		Map<String, String> moduleCacheInfo = null;
		if (request.getAttribute(LayerImpl.LAYERCACHEINFO_PROPNAME) != null) {
			moduleCacheInfo = new HashMap<String, String>();
			request.setAttribute(IModuleCache.MODULECACHEINFO_PROPNAME, moduleCacheInfo);
		}

		if (RequestUtil.isDependencyExpansionLogging(request)) {
			DependencyList depList = (DependencyList)request.getAttribute(LayerImpl.EXPANDEDDEPS_PROPNAME);
			if (depList != null) {
				// Output dependency expansion logging
				writer.append(dependencyExpansionLogging(depList));
			}
		}

		List<ModuleBuildFuture> futures = collectFutures(moduleList, request);
		SortedReaders sorted = new SortedReaders(futures, request);

		/*
		 * Set layer dependent features attribute.  The build readers add the layer dependent features
		 * to this collection as they are read.
		 */
		request.setAttribute(ILayer.DEPENDENT_FEATURES, dependentFeatures);

		writer.append(notifyLayerListeners(EventType.BEGIN_LAYER, request, null));
		addTransportContribution(LayerContributionType.BEGIN_RESPONSE, null);

		// Add script files to the layer first.  Scripts have no transport contribution
		for (Map.Entry<IModule, ModuleBuildReader> entry : sorted.getScripts().entrySet()) {
			processReader(entry.getKey(), entry.getValue());
		}
		if (sorted.getCacheEntries().size() > 0 || sorted.getModules().size() > 0) {
			writer.append(notifyLayerListeners(EventType.BEGIN_AMD, request, null));

			// Now add the loader cache entries.
			if (sorted.getCacheEntries().size() > 0) {
				addTransportContribution(LayerContributionType.BEGIN_LAYER_MODULES, moduleList.getRequiredModules());
				int i = 0;
				for (Map.Entry<IModule, ModuleBuildReader> entry : sorted.getCacheEntries().entrySet()) {
					writer.append(notifyLayerListeners(EventType.BEGIN_MODULE, request, entry.getKey()));
					ModuleInfo info = new ModuleInfo(entry.getKey().getModuleId(), entry.getValue().isScript());
					LayerContributionType type = (i++ == 0) ? LayerContributionType.BEFORE_FIRST_LAYER_MODULE : LayerContributionType.BEFORE_SUBSEQUENT_LAYER_MODULE;
					addTransportContribution(type, info);
					processReader(entry.getKey(), entry.getValue());
					addTransportContribution(LayerContributionType.AFTER_LAYER_MODULE, info);
				}
				addTransportContribution(LayerContributionType.END_LAYER_MODULES, moduleList.getRequiredModules());
			}

			// Now add the loader requested modules
			if (sorted.getModules().size() > 0) {
				Set<String> mids = new LinkedHashSet<String>();
				for (IModule module : sorted.getModules().keySet()) {
					mids.add(module.getModuleId());
				}
				addTransportContribution(LayerContributionType.BEGIN_MODULES, mids);
				int i = 0;
				for (Map.Entry<IModule, ModuleBuildReader> entry : sorted.getModules().entrySet()) {
					writer.append(notifyLayerListeners(EventType.BEGIN_MODULE, request, entry.getKey()));
					ModuleInfo info = new ModuleInfo(entry.getKey().getModuleId(), entry.getValue().isScript());
					LayerContributionType type = (i++ == 0) ? LayerContributionType.BEFORE_FIRST_MODULE : LayerContributionType.BEFORE_SUBSEQUENT_MODULE;
					addTransportContribution(type, info);
					processReader(entry.getKey(), entry.getValue());
					addTransportContribution(LayerContributionType.AFTER_MODULE, info);
				}
				addTransportContribution(LayerContributionType.END_MODULES, mids);
			}
		}
 		writer.append(notifyLayerListeners(EventType.END_LAYER, request, null));
		addTransportContribution(LayerContributionType.END_RESPONSE, null);

		moduleList.getDependentFeatures().addAll(dependentFeatures);

		// Output any messages to the console if debug mode is enabled
		if (options.isDebugMode() || options.isDevelopmentMode()) {
			for (String errorMsg : errorMessages) {
				writer.append("\r\nconsole.error(\"" + errorMsg + "\");"); //$NON-NLS-1$ //$NON-NLS-2$
			}
			for (String msg : nonErrorMessages) {
				writer.append("\r\nconsole.warn(\"" + msg + "\");"); //$NON-NLS-1$ //$NON-NLS-2$
			}
		}
		// Help out the GC
		sorted.clear();
		futures.clear();
		layerListenerModuleList.clear();

		if (sectionCount > 0) {
			// If any of the modules in the layer contained source map info, then
			// create a source map for the layer and include the source mapping URL
			// in the response.
			writer.append("\n").append(getSourcesMappingEpilogue()); //$NON-NLS-1$
			finalizeSourceMap();
		}

		return writer.toString();
	}
510192
public SourceMap toJSON() {
        SourceMap map = new SourceMap();
        map.version = this._version;
        map.sources = this._sources.toArray();
        map.names = this._names.toArray();
        map.mappings = serializeMappings();
        map.file = this._file;
        map.sourceRoot = this._sourceRoot;
        if (this._sourcesContents != null) {
            map.sourcesContent = _generateSourcesContent(map.sources, this._sourceRoot);
        }
        return map;
    }
1202161
static Map<String, ?> buildSourceByJsonMapper(String jsonObjectString) {
        try {
            return JsonMapper.readValue(jsonObjectString, MAP_TYPE_REFERENCE);
        } catch (Exception e) {
            return JMExceptionManager.handleExceptionAndThrowRuntimeEx(log, e,
                    "buildSourceByJsonMapper", jsonObjectString);
        }
    }
1286612
public String serialize(Map<String, T> map) throws IOException {
        StringWriter sw = new StringWriter();
        JsonGenerator jsonGenerator = LoganSquare.JSON_FACTORY.createGenerator(sw);
        serialize(map, jsonGenerator);
        jsonGenerator.close();
        return sw.toString();
    }
641165
public static Props fromJSONString(final String json) throws IOException {
    final Map<String, String> obj = (Map<String, String>) JSONUtils.parseJSONFromString(json);
    final Props props = new Props(null, obj);
    return props;
  }
571063
private <T> T convertObject(byte[] json, Class<T> claz) throws IOException {
        TypeReference<RestSuccessResult<Map<?, ?>>> typeReference = new TypeReference<RestSuccessResult<Map<?, ?>>>() {
        };
        RestSuccessResult<T> successResponse = MAPPER.readValue(json, typeReference);
        Map<?, ?> data = (Map<?, ?>) successResponse.getData();
        return MAPPER.convertValue(data, claz);
    }
252392
protected Map jsonStringToMap(String json) throws IOException {
        return new JaxbJsonSerializer<HashMap>(HashMap.class).deserialize(json);
    }
563143
private Map<String, Object> getMapFromJSON(String json) {
        Map<String, Object> propMap = new HashMap<String, Object>();
        ObjectMapper mapper = new ObjectMapper();

        // Initialize string if empty
        if (json == null || json.length() == 0) {
            json = "{}";
        }

        try {
            // Convert string
            propMap = mapper.readValue(json, new TypeReference<HashMap<String, Object>>(){});
        } catch (Exception e) {
            ;
        }
        return propMap;
    }
1119611
private static Map<String, Map<String, String>> getStatsMap(String json)
      throws IOException {
    if (json == null || json.isEmpty()) {
      return new HashMap<String, Map<String, String>>();
    }
    TypeReference<Map<String, Map<String, String>>> type = new TypeReference<Map<String, Map<String, String>>>() {
    };
    return mapper.readValue(json, type);
  }
544641
public static JSONObject toJsonObject(Map<String, ?> map) {
    JSONObject jsonObject = new JSONObject();
    for (Map.Entry<String, ?> entry : map.entrySet()) {
      Object value = wrap(entry.getValue());
      try {
        jsonObject.put(entry.getKey(), value);
      } catch (JSONException ignored) {
        // Ignore values that JSONObject doesn't accept.
      }
    }
    return jsonObject;
  }
1273850
JsonObject toJsonObject() {
        JsonObjectBuilder ob = Json.createObjectBuilder();
        ob.add("id", enrollmentID);
        ob.add("type", type);
        if (this.secret != null) {
            ob.add("secret", secret);
        }
        if (null != maxEnrollments) {

            ob.add("max_enrollments", maxEnrollments);
        }
        if (affiliation != null) {
            ob.add("affiliation", affiliation);
        }

        JsonArrayBuilder ab = Json.createArrayBuilder();
        for (Attribute attr : attrs) {
            ab.add(attr.toJsonObject());
        }
        if (caName != null) {
            ob.add(HFCAClient.FABRIC_CA_REQPROP, caName);
        }
        ob.add("attrs", ab.build());
        return ob.build();
    }
1339151
public static String buildSecretFromJwk(final String json) {
        CommonHelper.assertNotBlank("json", json);

        try {
            final OctetSequenceKey octetSequenceKey = OctetSequenceKey.parse(json);
            return new String(octetSequenceKey.toByteArray(), "UTF-8");
        } catch (final UnsupportedEncodingException | ParseException e) {
            throw new TechnicalException(e);
        }
    }
691300
public Map<String, Object> build() {
        final ImmutableMap.Builder<String, Object> builder = ImmutableMap.builder();
        //noinspection unchecked
        ofNullable(uploadOptions).map(x -> builder.putAll(x.build()));
        return builder.build();
    }
893705
def delete_build_configuration(id=None, name=None):
    
    data = delete_build_configuration_raw(id, name)
    if data:
        return utils.format_json(data)
1223452
public OvhAsyncTask<OvhBuilding> eligibility_search_buildingDetails_POST(String building) throws IOException {
		String qPath = "/connectivity/eligibility/search/buildingDetails";
		StringBuilder sb = path(qPath);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "building", building);
		String resp = execN(qPath, "POST", sb.toString(), o);
		return convertTo(resp, t5);
	}