+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+\r
package org.openecomp.mso.bpmn.core.domain;\r
\r
import java.io.IOException;\r
import com.fasterxml.jackson.databind.annotation.JsonSerialize;\r
\r
import org.openecomp.mso.logger.MsoLogger;\r
-//import org.codehaus.jackson.map.SerializationConfig.Feature;\r
+//import com.fasterxml.jackson.map.SerializationFeature;\r
\r
\r
/**\r
public JSONObject toJsonObject(){\r
\r
ObjectMapper mapper = new ObjectMapper();\r
- // mapper.configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, true);\r
+ // mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);\r
//mapper.enable(SerializationFeature.WRAP_ROOT_VALUE);\r
\r
mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);\r
- // mapper.enable(org.codehaus.jackson.map.DeserializationConfig.Feature.UNWRAP_ROOT_VALUE);\r
+ // mapper.enable(com.fasterxml.jackson.map.DeserializationFeature.UNWRAP_ROOT_VALUE);\r
JSONObject json = new JSONObject();\r
try {\r
json = new JSONObject(mapper.writeValueAsString(this));\r
- } catch (JsonGenerationException e) {\r
- LOGGER.debug("Exception :",e);\r
- } catch (JsonMappingException e) {\r
- LOGGER.debug("Exception :",e);\r
- } catch (JSONException e) {\r
- LOGGER.debug("Exception :",e);\r
- } catch (IOException e) {\r
+ } catch (JSONException | IOException e) {\r
LOGGER.debug("Exception :",e);\r
}\r
- return json; \r
+ return json;\r
}\r
\r
public String listToJson(List list) {\r
String jsonString = "";\r
try {\r
jsonString = mapper.writeValueAsString(list);\r
- } catch (JsonGenerationException e) {\r
- LOGGER.debug("Exception :",e);\r
- } catch (JsonMappingException e) {\r
- LOGGER.debug("Exception :",e);\r
} catch (IOException e) {\r
LOGGER.debug("Exception :",e);\r
}\r
/**\r
* Returns a string representation of this object.\r
*/\r
+ @Override\r
public String toString() {\r
return this.toJsonString();\r
}\r