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.main;
24 import java.util.HashMap;
27 public class ReturnType {
28 private ResultType result;
29 private String message;
31 private String timingInfo;
33 public ReturnType(ResultType result, String message) {
36 this.message = message;
39 public String getTimingInfo() {
43 public void setTimingInfo(String timingInfo) {
44 this.timingInfo = timingInfo;
47 public ResultType getResult() {
51 public String getMessage() {
55 public void setMessage(String message) {
56 this.message = message;
59 public String toJson() {
60 return "{ \"result\":\"" + result.getResult() + "\", \"message\":\"" + message + "\"}";
63 public String toString() {
64 return result + " | " + message;
67 public Map<String, Object> toMap() {
68 Map<String, Object> newMap = new HashMap<>();
69 newMap.put("result", result.getResult());
70 newMap.put("message", message);