6c6060d8bc31dd3b8b8568b6945e404e96d32ab0
[logging-analytics.git] / reference / slf4j-reference / src / main / java / org / onap / logging / ref / slf4j / demo / bean / AbstractBean.java
1 /**
2  * ============LICENSE_START=======================================================
3  * org.onap.logging
4  * ================================================================================
5  * Copyright © 2018 Amdocs
6  * All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *    http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  */
21
22 package org.onap.logging.ref.slf4j.demo.bean;
23
24 import org.json.JSONObject;
25
26 /**
27  * Base class for {@link Request} and {@link Response} beans, since
28  * they're almost the same thing.
29  */
30 public abstract class AbstractBean {
31
32     /** Bean property. */
33     private String mService;
34
35     /** Bean property. */
36     private String mCode;
37
38     /** Bean property. */
39     private String mSeverity;
40
41     /**
42      * Getter.
43      * @return bean property.
44      */
45     public String getService() {
46         return this.mService;
47     }
48
49     /**
50      * Setter.
51      * @param service bean property.
52      */
53     public void setService(final String service) {
54         this.mService = service;
55     }
56
57     /**
58      * Getter.
59      * @return bean property.
60      */
61     public String getCode() {
62         return this.mCode;
63     }
64
65     /**
66      * Setter.
67      * @param code bean property.
68      */
69     public void setCode(final String code) {
70         this.mCode = code;
71     }
72
73     /**
74      * Getter.
75      * @return bean property.
76      */
77     public String getSeverity() {
78         return this.mSeverity;
79     }
80
81     /**
82      * Setter.
83      * @param severity bean property.
84      */
85     public void setSeverity(final String severity) {
86         this.mSeverity = severity;
87     }
88
89     /**
90      * {@inheritDoc}
91      */
92     @Override
93     public String toString() {
94         return new JSONObject(this).toString(4);
95     }
96 }