JSON objects now displaying as string
[so.git] / so-monitoring / so-monitoring-handler / src / main / java / org / onap / so / monitoring / model / SoInfraRequestBuilder.java
1 /*-
2  * ============LICENSE_START=======================================================
3  *  Copyright (C) 2018 Ericsson. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  * 
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  * 
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * 
17  * SPDX-License-Identifier: Apache-2.0
18  * ============LICENSE_END=========================================================
19  */
20 package org.onap.so.monitoring.model;
21
22 import java.sql.Timestamp;
23
24 /**
25  * @author waqas.ikram@ericsson.com
26  */
27 public class SoInfraRequestBuilder {
28
29     private String requestId;
30     private String serviceInstanceId;
31     private String serviceIstanceName;
32     private String networkId;
33     private String requestStatus;
34     private String serviceType;
35     private String startTime;
36     private String endTime;
37
38     public SoInfraRequestBuilder setRequestId(final String requestId) {
39         this.requestId = requestId;
40         return this;
41     }
42
43     public SoInfraRequestBuilder setServiceInstanceId(final String serviceInstanceId) {
44         this.serviceInstanceId = serviceInstanceId;
45         return this;
46     }
47
48     public SoInfraRequestBuilder setServiceIstanceName(final String serviceIstanceName) {
49         this.serviceIstanceName = serviceIstanceName;
50         return this;
51     }
52
53     public SoInfraRequestBuilder setNetworkId(final String networkId) {
54         this.networkId = networkId;
55         return this;
56     }
57
58     public SoInfraRequestBuilder setRequestStatus(final String requestStatus) {
59         this.requestStatus = requestStatus;
60         return this;
61     }
62
63     public SoInfraRequestBuilder setServiceType(final String serviceType) {
64         this.serviceType = serviceType;
65         return this;
66     }
67
68     public SoInfraRequestBuilder setEndTime(final String endTime) {
69         this.endTime = endTime;
70         return this;
71     }
72
73     public SoInfraRequestBuilder setEndTime(final Timestamp endTime) {
74         this.endTime = endTime != null ? endTime.toString() : null;
75         return this;
76     }
77
78
79     public SoInfraRequestBuilder setStartTime(final String startTime) {
80         this.startTime = startTime;
81         return this;
82     }
83
84     public SoInfraRequestBuilder setStartTime(final Timestamp startTime) {
85         this.startTime = startTime != null ? startTime.toString() : null;
86         return this;
87     }
88
89     public SoInfraRequest build() {
90         return new SoInfraRequest(this);
91     }
92
93     /**
94      * @return the requestId
95      */
96     public String getRequestId() {
97         return requestId;
98     }
99
100     /**
101      * @return the serviceInstanceId
102      */
103     public String getServiceInstanceId() {
104         return serviceInstanceId;
105     }
106
107     /**
108      * @return the serviceIstanceName
109      */
110     public String getServiceIstanceName() {
111         return serviceIstanceName;
112     }
113
114     /**
115      * @return the networkId
116      */
117     public String getNetworkId() {
118         return networkId;
119     }
120
121     /**
122      * @return the requestStatus
123      */
124     public String getRequestStatus() {
125         return requestStatus;
126     }
127
128     /**
129      * @return the serviceType
130      */
131     public String getServiceType() {
132         return serviceType;
133     }
134
135     /**
136      * @return the startTime
137      */
138     public String getStartTime() {
139         return startTime;
140     }
141
142     /**
143      * @return the endTime
144      */
145     public String getEndTime() {
146         return endTime;
147     }
148 }