Replaced all tabs with spaces in java and pom.xml
[so.git] / common / src / main / java / org / onap / so / client / dmaap / rest / PropertiesBean.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.onap.so.client.dmaap.rest;
22
23 import java.util.Properties;
24
25 public class PropertiesBean {
26
27     private String auth;
28     private String key;
29     private String environment;
30     private String partition;
31     private String contentType;
32     private String host;
33     private String topic;
34     private String timeout;
35
36
37     public PropertiesBean(Properties properties) {
38         this.withAuth(properties.getProperty("auth")).withKey(properties.getProperty("key"))
39                 .withTopic(properties.getProperty("topic")).withEnvironment(properties.getProperty("environment"))
40                 .withHost(properties.getProperty("host")).withTimeout(properties.getProperty("timeout", "20000"))
41                 .withPartition(properties.getProperty("partition"))
42                 .withContentType(properties.getProperty("contentType", "application/json"));
43     }
44
45     public String getAuth() {
46         return auth;
47     }
48
49     public void setAuth(String auth) {
50         this.auth = auth;
51     }
52
53     public PropertiesBean withAuth(String auth) {
54         this.auth = auth;
55         return this;
56     }
57
58     public String getKey() {
59         return key;
60     }
61
62     public void setKey(String key) {
63         this.key = key;
64     }
65
66     public PropertiesBean withKey(String key) {
67         this.key = key;
68         return this;
69     }
70
71     public String getEnvironment() {
72         return environment;
73     }
74
75     public void setEnvironment(String environment) {
76         this.environment = environment;
77     }
78
79     public PropertiesBean withEnvironment(String environment) {
80         this.environment = environment;
81         return this;
82     }
83
84     public String getPartition() {
85         return partition;
86     }
87
88     public void setPartition(String partition) {
89         this.partition = partition;
90     }
91
92     public PropertiesBean withPartition(String partition) {
93         this.partition = partition;
94         return this;
95     }
96
97     public String getContentType() {
98         return contentType;
99     }
100
101     public void setContentType(String contentType) {
102         this.contentType = contentType;
103     }
104
105     public PropertiesBean withContentType(String contentType) {
106         this.contentType = contentType;
107         return this;
108     }
109
110     public String getHost() {
111         return host;
112     }
113
114     public void setHost(String host) {
115         this.host = host;
116     }
117
118     public PropertiesBean withHost(String host) {
119         this.host = host;
120         return this;
121     }
122
123     public String getTopic() {
124         return topic;
125     }
126
127     public void setTopic(String topic) {
128         this.topic = topic;
129     }
130
131     public PropertiesBean withTopic(String topic) {
132         this.topic = topic;
133         return this;
134     }
135
136     public String getTimeout() {
137         return timeout;
138     }
139
140     public void setTimeout(String timeout) {
141         this.timeout = timeout;
142     }
143
144     public PropertiesBean withTimeout(String timeout) {
145         this.timeout = timeout;
146         return this;
147     }
148
149
150
151 }