@@ -0,0 +1,1449 @@
+/*%0A *  Copyright (c) 2017 Ot%C3%A1vio Santana and others%0A *   All rights reserved. This program and the accompanying materials%0A *   are made available under the terms of the Eclipse Public License v1.0%0A *   and Apache License v2.0 which accompanies this distribution.%0A *   The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html%0A *   and the Apache License v2.0 is available at http://www.opensource.org/licenses/apache2.0.php.%0A *%0A *   You may elect to redistribute this code under either of these licenses.%0A *%0A *   Contributors:%0A *%0A *   Otavio Santana%0A */%0Apackage org.jnosql.diana.couchbase.key;%0A%0Aimport com.couchbase.client.java.document.json.JsonObject;%0A%0Aimport javax.json.bind.Jsonb;%0Aimport java.io.ByteArrayInputStream;%0Aimport java.io.ByteArrayOutputStream;%0Aimport java.io.InputStream;%0Aimport java.lang.reflect.Type;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0Afinal class JsonObjectCouchbaseUtil %7B%0A%0A    private static final Type TYPE = new HashMap%3CString, Object%3E() %7B%0A    %7D.getClass().getGenericSuperclass();%0A%0A    private JsonObjectCouchbaseUtil() %7B%0A    %7D%0A%0A    static JsonObject toJson(Jsonb jsonb, Object value) %7B%0A%0A        ByteArrayOutputStream stream = new ByteArrayOutputStream();%0A        jsonb.toJson(value, stream);%0A        InputStream inputStream = new ByteArrayInputStream(stream.toByteArray());%0A        Map%3CString, ?%3E map = jsonb.fromJson(inputStream, TYPE);%0A%0A        return JsonObject.from(map);%0A%0A    %7D%0A%7D%0A

create a jsonobject coubaseutil