Skip to content

Package: ApplicationJsonEntityBuilder

ApplicationJsonEntityBuilder

nameinstructionbranchcomplexitylinemethod
buildFrom(String)
M: 7 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2020, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.elasticsearch.client.rest.utils;
14:
15: import org.apache.http.HttpEntity;
16: import org.apache.http.client.entity.EntityBuilder;
17: import org.apache.http.entity.ContentType;
18:
19: /**
20: * Utility class that builds an {@link HttpEntity} with {@link EntityBuilder#setContentType(ContentType)} set to {@link ContentType#APPLICATION_JSON}.
21: * <p>
22: * Hence the name, what a surprise!
23: *
24: * @since 1.3.0
25: * @deprecated 1.5.0
26: */
27: @Deprecated
28: public class ApplicationJsonEntityBuilder {
29:
30: private ApplicationJsonEntityBuilder() {
31: }
32:
33: public static HttpEntity buildFrom(String jsonText) {
34: return EntityBuilder.create()
35: .setText(jsonText)
36: .setContentType(ContentType.APPLICATION_JSON)
37: .build();
38: }
39: }