* ============LICENSE_START=======================================================
* org.onap.dcaegen2.collectors.ves
* ================================================================================
- * Copyright (C) 2018 Nokia. All rights reserved.
+ * Copyright (C) 2018,2020 Nokia. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* limitations under the License.
* ============LICENSE_END=========================================================
*/
-package org.onap.dcae.controller;
+package org.onap.dcae.configuration;
import static org.onap.dcae.common.publishing.VavrUtils.enhanceError;
import java.util.Spliterator;
import java.util.Spliterators;
import java.util.stream.StreamSupport;
-import org.json.JSONArray;
import org.json.JSONObject;
/**
.mapFailure(enhanceError("Value '%s' is not a valid JSON document", strBody));
}
- static Try<JSONArray> toJsonArray(String strBody) {
- return API.Try(() -> new JSONArray(strBody))
- .mapFailure(enhanceError("Value '%s' is not a valid JSON array", strBody));
- }
-
static <T> List<T> toList(Iterator<T> iterator) {
- return List.ofAll(StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED), false));
+ return List
+ .ofAll(StreamSupport.stream(Spliterators.spliteratorUnknownSize(iterator, Spliterator.ORDERED), false));
}
-
-}
+}
\ No newline at end of file