2 * ============LICENSE_START==========================================
4 * ===================================================================
5 * Copyright (c) 2017 AT&T Intellectual Property
6 * ===================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 * ============LICENSE_END=============================================
20 * ====================================================================
22 package org.onap.music.response.jsonobjects;
25 import java.util.HashMap;
27 import io.swagger.annotations.ApiModel;
28 import io.swagger.annotations.ApiModelProperty;
30 @ApiModel(value = "JsonResponse", description = "General Response JSON")
31 public class JsonResponse {
33 private Boolean status = false;
34 private String error = "";
35 private String version = "";
37 public JsonResponse(Boolean status, String error, String version) {
40 this.version = version;
43 public JsonResponse() {
49 @ApiModelProperty(value = "Status value")
50 public Boolean getStatus() {
59 private String fixStatus(String statusIn) {
60 if (statusIn.equalsIgnoreCase("false")) {
66 public void setStatus(Boolean status) {
70 @ApiModelProperty(value = "Error value")
71 public String getError() {
75 public void setError(String error) {
79 @ApiModelProperty(value = "Version value")
80 public String getVersion() {
84 public void setVersion(String version) {
85 this.version = version;
88 public Map<String, Object> toMap() {
89 Map<String, Object> newMap = new HashMap<>();
90 newMap.put("status", fixStatus(String.valueOf(status)));
91 newMap.put("error", error);
92 newMap.put("version", version);